Add english version

This commit is contained in:
OleSTEEP 2024-01-15 18:44:53 +03:00
parent 7bf44fa645
commit 49e9a37f3c
1675 changed files with 1309268 additions and 0 deletions

16
www.eng/js/jsconfig.json Normal file
View file

@ -0,0 +1,16 @@
{
"compilerOptions": {
"target":"es6"
},
"files": [
"./rmmv.d.ts",
"./rmmv-pixi.d.ts"
],
"include": [
"./*",
"./plugins_dev/*.js",
"./plugins/*.js",
"libs/yaml.js",
"porting/require.js"
]
}

View file

@ -0,0 +1,69 @@
[Settings]
;game appid here
AppID = 1150690
;source steam_api.dll version
API = 4.28.51.7
;player name
PlayerName = STEAMRIP
;game Language
;english german french italian koreana
;spanish schinese tchinese russian thai
;japanese portuguese polish danish dutch
;finnish norwegian swedish hungarian czech
;romanian turkish
Language = english
;save types:
;ALI213(game dir) 0
;ALI213(my documents) 1
;RELOADED 4
;SKIDROW 5
;FLT 6
;CODEX(3.0.4+/my documents) 7
;CODEX(1.0.0.0+/APPDATA) 8
SaveType = 0
;Achievements Count limit
;AchievementsCount = 0
;game exe path
;GameEXE = game.exe
;SteamUserID = 12345678
;SteamUserIDH = 12345678
;IsLoggedOn = 0
;Online = 0
UnLockListedDLCOnly = 1
[DLC]
;SET DLC USE "APPID=NAME"
[Option]
;Block Network.
;FullBlockNetwork = 0
;Redirect File Handle to ".valve"
FileRedirectCheck = 1
;DECRYPT STEAM STUB
;set 1 tells steam_api.dll / steam_api64.dll to decrypt the steam stub as soon as possible
;set 2 tells SteamClient.dll / SteamClient64.dll to decrypt the steam stub as soon as possible
;set 0 to disable it.
;DECRYPT_STEAM_STUB = 0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,733 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var dragonBones;
(function (dragonBones) {
/**
* @language zh_CN
* Pixi 贴图集数据
* @version DragonBones 3.0
*/
var PixiTextureAtlasData = (function (_super) {
__extends(PixiTextureAtlasData, _super);
/**
* @private
*/
function PixiTextureAtlasData() {
return _super.call(this) || this;
}
/**
* @private
*/
PixiTextureAtlasData.toString = function () {
return "[class dragonBones.PixiTextureAtlasData]";
};
/**
* @private
*/
PixiTextureAtlasData.prototype._onClear = function () {
_super.prototype._onClear.call(this);
if (this.texture) {
//this.texture.dispose();
}
this.texture = null;
};
/**
* @private
*/
PixiTextureAtlasData.prototype.generateTexture = function () {
return dragonBones.BaseObject.borrowObject(PixiTextureData);
};
return PixiTextureAtlasData;
}(dragonBones.TextureAtlasData));
dragonBones.PixiTextureAtlasData = PixiTextureAtlasData;
/**
* @private
*/
var PixiTextureData = (function (_super) {
__extends(PixiTextureData, _super);
function PixiTextureData() {
return _super.call(this) || this;
}
PixiTextureData.toString = function () {
return "[class dragonBones.PixiTextureData]";
};
PixiTextureData.prototype._onClear = function () {
_super.prototype._onClear.call(this);
if (this.texture) {
this.texture.destroy();
}
this.texture = null;
};
return PixiTextureData;
}(dragonBones.TextureData));
dragonBones.PixiTextureData = PixiTextureData;
})(dragonBones || (dragonBones = {}));
var dragonBones;
(function (dragonBones) {
/**
* @inheritDoc
*/
var PixiArmatureDisplay = (function (_super) {
__extends(PixiArmatureDisplay, _super);
/**
* @internal
* @private
*/
function PixiArmatureDisplay() {
return _super.call(this) || this;
}
/**
* @private
*/
PixiArmatureDisplay.prototype._onClear = function () {
if (this._debugDrawer) {
this._debugDrawer.destroy(true);
}
this._armature = null;
this._debugDrawer = null;
this.destroy();
};
/**
* @private
*/
PixiArmatureDisplay.prototype._dispatchEvent = function (type, eventObject) {
this.emit(type, eventObject);
};
/**
* @private
*/
PixiArmatureDisplay.prototype._debugDraw = function (isEnabled) {
if (!this._debugDrawer) {
this._debugDrawer = new PIXI.Sprite();
var boneDrawer = new PIXI.Graphics();
this._debugDrawer.addChild(boneDrawer);
}
if (isEnabled) {
this.addChild(this._debugDrawer);
var boneDrawer = this._debugDrawer.getChildAt(0);
boneDrawer.clear();
var bones = this._armature.getBones();
for (var i = 0, l = bones.length; i < l; ++i) {
var bone = bones[i];
var boneLength = bone.boneData.length;
var startX = bone.globalTransformMatrix.tx;
var startY = bone.globalTransformMatrix.ty;
var endX = startX + bone.globalTransformMatrix.a * boneLength;
var endY = startY + bone.globalTransformMatrix.b * boneLength;
boneDrawer.lineStyle(2, bone.ik ? 0xFF0000 : 0x00FFFF, 0.7);
boneDrawer.moveTo(startX, startY);
boneDrawer.lineTo(endX, endY);
boneDrawer.lineStyle(0, 0, 0);
boneDrawer.beginFill(0x00FFFF, 0.7);
boneDrawer.drawCircle(startX, startY, 3);
boneDrawer.endFill();
}
var slots = this._armature.getSlots();
for (var i = 0, l = slots.length; i < l; ++i) {
var slot = slots[i];
var boundingBoxData = slot.boundingBoxData;
if (boundingBoxData) {
var child = this._debugDrawer.getChildByName(slot.name);
if (!child) {
child = new PIXI.Graphics();
child.name = slot.name;
this._debugDrawer.addChild(child);
}
child.clear();
child.beginFill(0xFF00FF, 0.3);
switch (boundingBoxData.type) {
case 0 /* Rectangle */:
child.drawRect(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
break;
case 1 /* Ellipse */:
child.drawEllipse(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
break;
case 2 /* Polygon */:
var vertices = boundingBoxData.vertices;
for (var i_1 = 0, l_1 = boundingBoxData.vertices.length; i_1 < l_1; i_1 += 2) {
if (i_1 === 0) {
child.moveTo(vertices[i_1], vertices[i_1 + 1]);
}
else {
child.lineTo(vertices[i_1], vertices[i_1 + 1]);
}
}
break;
default:
break;
}
child.endFill();
slot._updateTransformAndMatrix();
slot.updateGlobalTransform();
var transform = slot.global;
child.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX, slot._pivotX, slot._pivotY);
}
else {
var child = this._debugDrawer.getChildByName(slot.name);
if (child) {
this._debugDrawer.removeChild(child);
}
}
}
}
else if (this._debugDrawer && this._debugDrawer.parent === this) {
this.removeChild(this._debugDrawer);
}
};
/**
* @inheritDoc
*/
PixiArmatureDisplay.prototype.hasEvent = function (type) {
return this.listeners(type, true); // .d.ts bug
};
/**
* @inheritDoc
*/
PixiArmatureDisplay.prototype.addEvent = function (type, listener, target) {
this.addListener(type, listener, target);
};
/**
* @inheritDoc
*/
PixiArmatureDisplay.prototype.removeEvent = function (type, listener, target) {
this.removeListener(type, listener, target);
};
/**
* @inheritDoc
*/
PixiArmatureDisplay.prototype.dispose = function (disposeProxy) {
if (disposeProxy === void 0) { disposeProxy = true; }
if (this._armature) {
this._armature.dispose();
this._armature = null;
}
};
Object.defineProperty(PixiArmatureDisplay.prototype, "armature", {
/**
* @inheritDoc
*/
get: function () {
return this._armature;
},
enumerable: true,
configurable: true
});
Object.defineProperty(PixiArmatureDisplay.prototype, "animation", {
/**
* @inheritDoc
*/
get: function () {
return this._armature.animation;
},
enumerable: true,
configurable: true
});
/**
* @deprecated
* @see dragonBones.Armature#clock
* @see dragonBones.PixiFactory#clock
* @see dragonBones.Animation#timescale
* @see dragonBones.Animation#stop()
*/
PixiArmatureDisplay.prototype.advanceTimeBySelf = function (on) {
if (on) {
this._armature.clock = dragonBones.PixiFactory.clock;
}
else {
this._armature.clock = null;
}
};
return PixiArmatureDisplay;
}(PIXI.Container));
dragonBones.PixiArmatureDisplay = PixiArmatureDisplay;
})(dragonBones || (dragonBones = {}));
var dragonBones;
(function (dragonBones) {
/**
* @language zh_CN
* Pixi 插槽
* @version DragonBones 3.0
*/
var PixiSlot = (function (_super) {
__extends(PixiSlot, _super);
/**
* @internal
* @private
*/
function PixiSlot() {
var _this = _super.call(this) || this;
_this._updateTransform = PIXI.VERSION[0] === "3" ? _this._updateTransformV3 : _this._updateTransformV4;
return _this;
}
/**
* @private
*/
PixiSlot.toString = function () {
return "[class dragonBones.PixiSlot]";
};
/**
* @private
*/
PixiSlot.prototype._onClear = function () {
_super.prototype._onClear.call(this);
this._renderDisplay = null;
};
/**
* @private
*/
PixiSlot.prototype._initDisplay = function (value) {
};
/**
* @private
*/
PixiSlot.prototype._disposeDisplay = function (value) {
value.destroy();
};
/**
* @private
*/
PixiSlot.prototype._onUpdateDisplay = function () {
this._renderDisplay = (this._display ? this._display : this._rawDisplay);
};
/**
* @private
*/
PixiSlot.prototype._addDisplay = function () {
var container = this._armature.display;
container.addChild(this._renderDisplay);
};
/**
* @private
*/
PixiSlot.prototype._replaceDisplay = function (value) {
var container = this._armature.display;
var prevDisplay = value;
container.addChild(this._renderDisplay);
container.swapChildren(this._renderDisplay, prevDisplay);
container.removeChild(prevDisplay);
};
/**
* @private
*/
PixiSlot.prototype._removeDisplay = function () {
this._renderDisplay.parent.removeChild(this._renderDisplay);
};
/**
* @private
*/
PixiSlot.prototype._updateZOrder = function () {
var container = this._armature.display;
var index = container.getChildIndex(this._renderDisplay);
if (index === this._zOrder) {
return;
}
container.addChildAt(this._renderDisplay, this._zOrder);
};
/**
* @internal
* @private
*/
PixiSlot.prototype._updateVisible = function () {
this._renderDisplay.visible = this._parent.visible;
};
/**
* @private
*/
PixiSlot.prototype._updateBlendMode = function () {
switch (this._blendMode) {
case 0 /* Normal */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.NORMAL;
break;
case 1 /* Add */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.ADD;
break;
case 3 /* Darken */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.DARKEN;
break;
case 4 /* Difference */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.DIFFERENCE;
break;
case 6 /* HardLight */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.HARD_LIGHT;
break;
case 9 /* Lighten */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.LIGHTEN;
break;
case 10 /* Multiply */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.MULTIPLY;
break;
case 11 /* Overlay */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.OVERLAY;
break;
case 12 /* Screen */:
this._renderDisplay.blendMode = PIXI.BLEND_MODES.SCREEN;
break;
default:
break;
}
};
/**
* @private
*/
PixiSlot.prototype._updateColor = function () {
this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
};
/**
* @private
*/
PixiSlot.prototype._updateFrame = function () {
var isMeshDisplay = this._meshData && this._display === this._meshDisplay;
var currentTextureData = this._textureData;
if (this._displayIndex >= 0 && this._display && currentTextureData) {
var currentTextureAtlasData = currentTextureData.parent;
// Update replaced texture atlas.
if (this._armature.replacedTexture && this._displayData && currentTextureAtlasData === this._displayData.texture.parent) {
currentTextureAtlasData = this._armature._replaceTextureAtlasData;
if (!currentTextureAtlasData) {
currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData);
currentTextureAtlasData.copyFrom(currentTextureData.parent);
currentTextureAtlasData.texture = this._armature.replacedTexture;
this._armature._replaceTextureAtlasData = currentTextureAtlasData;
}
currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name);
}
var currentTextureAtlas = currentTextureAtlasData.texture;
if (currentTextureAtlas) {
if (!currentTextureData.texture) {
currentTextureData.texture = new PIXI.Texture(currentTextureAtlas, currentTextureData.region, // No need to set frame.
currentTextureData.region, new PIXI.Rectangle(0, 0, currentTextureData.region.width, currentTextureData.region.height), currentTextureData.rotated // .d.ts bug
);
}
if (isMeshDisplay) {
var meshDisplay = this._renderDisplay;
var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : currentTextureAtlas.width;
var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : currentTextureAtlas.height;
meshDisplay.uvs = new Float32Array(this._meshData.uvs);
meshDisplay.vertices = new Float32Array(this._meshData.vertices);
meshDisplay.indices = new Uint16Array(this._meshData.vertexIndices);
for (var i = 0, l = meshDisplay.uvs.length; i < l; i += 2) {
var u = meshDisplay.uvs[i];
var v = meshDisplay.uvs[i + 1];
meshDisplay.uvs[i] = (currentTextureData.region.x + u * currentTextureData.region.width) / textureAtlasWidth;
meshDisplay.uvs[i + 1] = (currentTextureData.region.y + v * currentTextureData.region.height) / textureAtlasHeight;
}
meshDisplay.texture = currentTextureData.texture;
//meshDisplay.dirty = true; // Pixi 3.x
meshDisplay.dirty++; // Pixi 4.x Can not support change mesh vertice count.
}
else {
var normalDisplay = this._renderDisplay;
normalDisplay.texture = currentTextureData.texture;
}
this._updateVisible();
return;
}
}
if (isMeshDisplay) {
var meshDisplay = this._renderDisplay;
meshDisplay.texture = null;
meshDisplay.x = 0.0;
meshDisplay.y = 0.0;
meshDisplay.visible = false;
}
else {
var normalDisplay = this._renderDisplay;
normalDisplay.texture = null;
normalDisplay.x = 0.0;
normalDisplay.y = 0.0;
normalDisplay.visible = false;
}
};
/**
* @private
*/
PixiSlot.prototype._updateMesh = function () {
var meshDisplay = this._renderDisplay;
var hasFFD = this._ffdVertices.length > 0;
if (this._meshData.skinned) {
for (var i = 0, iF = 0, l = this._meshData.vertices.length; i < l; i += 2) {
var iH = i / 2;
var boneIndices = this._meshData.boneIndices[iH];
var boneVertices = this._meshData.boneVertices[iH];
var weights = this._meshData.weights[iH];
var xG = 0.0, yG = 0.0;
for (var iB = 0, lB = boneIndices.length; iB < lB; ++iB) {
var bone = this._meshBones[boneIndices[iB]];
var matrix = bone.globalTransformMatrix;
var weight = weights[iB];
var xL = 0.0, yL = 0.0;
if (hasFFD) {
xL = boneVertices[iB * 2] + this._ffdVertices[iF];
yL = boneVertices[iB * 2 + 1] + this._ffdVertices[iF + 1];
}
else {
xL = boneVertices[iB * 2];
yL = boneVertices[iB * 2 + 1];
}
xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight;
yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight;
iF += 2;
}
meshDisplay.vertices[i] = xG;
meshDisplay.vertices[i + 1] = yG;
}
}
else if (hasFFD) {
var vertices = this._meshData.vertices;
for (var i = 0, l = this._meshData.vertices.length; i < l; i += 2) {
var xG = vertices[i] + this._ffdVertices[i];
var yG = vertices[i + 1] + this._ffdVertices[i + 1];
meshDisplay.vertices[i] = xG;
meshDisplay.vertices[i + 1] = yG;
}
}
};
/**
* @private
*/
PixiSlot.prototype._updateTransform = function (isSkinnedMesh) {
throw new Error();
};
/**
* @private
*/
PixiSlot.prototype._updateTransformV3 = function (isSkinnedMesh) {
if (isSkinnedMesh) {
this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
else {
this.updateGlobalTransform(); // Update transform.
var x = this.globalTransformMatrix.tx - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); // Pixi pivot do not work.
var y = this.globalTransformMatrix.ty - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); // Pixi pivot do not work.
var transform = this.global;
this._renderDisplay.setTransform(x, y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX);
}
};
/**
* @private
*/
PixiSlot.prototype._updateTransformV4 = function (isSkinnedMesh) {
if (isSkinnedMesh) {
this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
else {
this.updateGlobalTransform(); // Update transform.
var transform = this.global;
this._renderDisplay.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX, this._pivotX, this._pivotY);
}
};
return PixiSlot;
}(dragonBones.Slot));
dragonBones.PixiSlot = PixiSlot;
})(dragonBones || (dragonBones = {}));
var dragonBones;
(function (dragonBones) {
/**
* @language zh_CN
* Pixi 工厂
* @version DragonBones 3.0
*/
var PixiFactory = (function (_super) {
__extends(PixiFactory, _super);
/**
* @language zh_CN
* 创建一个工厂 (通常只需要一个全局工厂实例)
* @param dataParser 龙骨数据解析器如果不设置则使用默认解析器
* @version DragonBones 3.0
*/
function PixiFactory(dataParser) {
if (dataParser === void 0) { dataParser = null; }
var _this = _super.call(this, dataParser) || this;
if (!PixiFactory._eventManager) {
PixiFactory._eventManager = new dragonBones.PixiArmatureDisplay();
PixiFactory._clock = new dragonBones.WorldClock();
PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
}
return _this;
}
PixiFactory._clockHandler = function (passedTime) {
PixiFactory._clock.advanceTime(-1); // passedTime !?
//console.log("Dragonbones' clock ticking");
};
Object.defineProperty(PixiFactory, "factory", {
/**
* @language zh_CN
* 一个可以直接使用的全局工厂实例
* @version DragonBones 4.7
*/
get: function () {
if (!PixiFactory._factory) {
PixiFactory._factory = new PixiFactory();
}
return PixiFactory._factory;
},
enumerable: true,
configurable: true
});
Object.defineProperty(PixiFactory, "clock", {
/**
* @language zh_CN
* 一个可以直接使用的全局 WorldClock 实例.
* @version DragonBones 5.0
*/
get: function () {
return PixiFactory._clock;
},
enumerable: true,
configurable: true
});
/**
* @private
*/
PixiFactory.prototype._generateTextureAtlasData = function (textureAtlasData, textureAtlas) {
if (textureAtlasData) {
textureAtlasData.texture = textureAtlas;
}
else {
textureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData);
}
return textureAtlasData;
};
/**
* @private
*/
PixiFactory.prototype._generateArmature = function (dataPackage) {
var armature = dragonBones.BaseObject.borrowObject(dragonBones.Armature);
var armatureDisplay = new dragonBones.PixiArmatureDisplay();
armatureDisplay._armature = armature;
armature._init(dataPackage.armature, dataPackage.skin, armatureDisplay, armatureDisplay, PixiFactory._eventManager);
return armature;
};
/**
* @private
*/
PixiFactory.prototype._generateSlot = function (dataPackage, skinSlotData, armature) {
var slotData = skinSlotData.slot;
var slot = dragonBones.BaseObject.borrowObject(dragonBones.PixiSlot);
var displayList = [];
slot._init(skinSlotData, new PIXI.Sprite(), new PIXI.mesh.Mesh(null, null, null, null, PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES));
for (var i = 0, l = skinSlotData.displays.length; i < l; ++i) {
var displayData = skinSlotData.displays[i];
switch (displayData.type) {
case 0 /* Image */:
if (!displayData.texture) {
displayData.texture = this._getTextureData(dataPackage.dataName, displayData.path);
}
if (dataPackage.textureAtlasName) {
slot._textureDatas[i] = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
}
displayList[i] = slot.rawDisplay;
break;
case 2 /* Mesh */:
if (!displayData.texture) {
displayData.texture = this._getTextureData(dataPackage.dataName, displayData.path);
}
if (dataPackage.textureAtlasName) {
slot._textureDatas[i] = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
}
if (!displayData.mesh && displayData.share) {
displayData.mesh = skinSlotData.getMesh(displayData.share);
}
displayList[i] = slot.meshDisplay;
break;
case 1 /* Armature */:
var childArmature = this.buildArmature(displayData.path, dataPackage.dataName, null, dataPackage.textureAtlasName);
if (childArmature) {
childArmature.inheritAnimation = displayData.inheritAnimation;
if (!childArmature.inheritAnimation) {
var actions = slotData.actions.length > 0 ? slotData.actions : childArmature.armatureData.actions;
if (actions.length > 0) {
for (var i_2 = 0, l_2 = actions.length; i_2 < l_2; ++i_2) {
childArmature._bufferAction(actions[i_2]);
}
}
else {
childArmature.animation.play();
}
}
displayData.armature = childArmature.armatureData; //
}
displayList[i] = childArmature;
break;
default:
displayList[i] = null;
break;
}
}
slot._setDisplayList(displayList);
return slot;
};
/**
* @language zh_CN
* 创建一个指定名称的骨架并使用骨架的显示容器来更新骨架动画
* @param armatureName 骨架名称
* @param dragonBonesName 龙骨数据名称如果未设置将检索所有的龙骨数据如果多个数据中包含同名的骨架数据可能无法创建出准确的骨架
* @param skinName 皮肤名称如果未设置则使用默认皮肤
* @param textureAtlasName 贴图集数据名称如果未设置则使用龙骨数据
* @returns 骨架的显示容器
* @see dragonBones.PixiArmatureDisplay
* @version DragonBones 4.5
*/
PixiFactory.prototype.buildArmatureDisplay = function (armatureName, dragonBonesName, skinName, textureAtlasName) {
if (dragonBonesName === void 0) { dragonBonesName = null; }
if (skinName === void 0) { skinName = null; }
if (textureAtlasName === void 0) { textureAtlasName = null; }
var armature = this.buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName);
if (armature) {
var armatureDisplay = armature.display;
PixiFactory._clock.add(armature);
return armatureDisplay;
}
return null;
};
/**
* @language zh_CN
* 获取带有指定贴图的显示对象
* @param textureName 指定的贴图名称
* @param dragonBonesName 指定的龙骨数据名称如果未设置将检索所有的龙骨数据
* @version DragonBones 3.0
*/
PixiFactory.prototype.getTextureDisplay = function (textureName, dragonBonesName) {
if (dragonBonesName === void 0) { dragonBonesName = null; }
var textureData = this._getTextureData(dragonBonesName, textureName);
if (textureData) {
if (!textureData.texture) {
var textureAtlasTexture = textureData.parent.texture;
var originSize = new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height);
textureData.texture = new PIXI.Texture(textureAtlasTexture, textureData.region, textureData.region, originSize, textureData.rotated // .d.ts bug
);
}
return new PIXI.Sprite(textureData.texture);
}
return null;
};
Object.defineProperty(PixiFactory.prototype, "soundEventManater", {
/**
* @language zh_CN
* 获取全局声音事件管理器
* @version DragonBones 4.5
*/
get: function () {
return PixiFactory._eventManager;
},
enumerable: true,
configurable: true
});
return PixiFactory;
}(dragonBones.BaseFactory));
PixiFactory._factory = null;
PixiFactory._eventManager = null;
PixiFactory._clock = null;
dragonBones.PixiFactory = PixiFactory;
})(dragonBones || (dragonBones = {}));

View file

@ -0,0 +1,15 @@
/*! FPSMeter 0.3.1 - 9th May 2013 | https://github.com/Darsain/fpsmeter */
(function(m,j){function s(a,e){for(var g in e)try{a.style[g]=e[g]}catch(j){}return a}function H(a){return null==a?String(a):"object"===typeof a||"function"===typeof a?Object.prototype.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof a}function R(a,e){if("array"!==H(e))return-1;if(e.indexOf)return e.indexOf(a);for(var g=0,j=e.length;g<j;g++)if(e[g]===a)return g;return-1}function I(){var a=arguments,e;for(e in a[1])if(a[1].hasOwnProperty(e))switch(H(a[1][e])){case "object":a[0][e]=
I({},a[0][e],a[1][e]);break;case "array":a[0][e]=a[1][e].slice(0);break;default:a[0][e]=a[1][e]}return 2<a.length?I.apply(null,[a[0]].concat(Array.prototype.slice.call(a,2))):a[0]}function N(a){a=Math.round(255*a).toString(16);return 1===a.length?"0"+a:a}function S(a,e,g,j){if(a.addEventListener)a[j?"removeEventListener":"addEventListener"](e,g,!1);else if(a.attachEvent)a[j?"detachEvent":"attachEvent"]("on"+e,g)}function D(a,e){function g(a,b,d,c){return y[0|a][Math.round(Math.min((b-d)/(c-d)*J,J))]}
function r(){f.legend.fps!==q&&(f.legend.fps=q,f.legend[T]=q?"FPS":"ms");K=q?b.fps:b.duration;f.count[T]=999<K?"999+":K.toFixed(99<K?0:d.decimals)}function m(){z=A();L<z-d.threshold&&(b.fps-=b.fps/Math.max(1,60*d.smoothing/d.interval),b.duration=1E3/b.fps);for(c=d.history;c--;)E[c]=0===c?b.fps:E[c-1],F[c]=0===c?b.duration:F[c-1];r();if(d.heat){if(w.length)for(c=w.length;c--;)w[c].el.style[h[w[c].name].heatOn]=q?g(h[w[c].name].heatmap,b.fps,0,d.maxFps):g(h[w[c].name].heatmap,b.duration,d.threshold,
0);if(f.graph&&h.column.heatOn)for(c=u.length;c--;)u[c].style[h.column.heatOn]=q?g(h.column.heatmap,E[c],0,d.maxFps):g(h.column.heatmap,F[c],d.threshold,0)}if(f.graph)for(p=0;p<d.history;p++)u[p].style.height=(q?E[p]?Math.round(O/d.maxFps*Math.min(E[p],d.maxFps)):0:F[p]?Math.round(O/d.threshold*Math.min(F[p],d.threshold)):0)+"px"}function k(){20>d.interval?(x=M(k),m()):(x=setTimeout(k,d.interval),P=M(m))}function G(a){a=a||window.event;a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue=
!1,a.cancelBubble=!0);b.toggle()}function U(){d.toggleOn&&S(f.container,d.toggleOn,G,1);a.removeChild(f.container)}function V(){f.container&&U();h=D.theme[d.theme];y=h.compiledHeatmaps||[];if(!y.length&&h.heatmaps.length){for(p=0;p<h.heatmaps.length;p++){y[p]=[];for(c=0;c<=J;c++){var b=y[p],e=c,g;g=0.33/J*c;var j=h.heatmaps[p].saturation,m=h.heatmaps[p].lightness,n=void 0,k=void 0,l=void 0,t=l=void 0,v=n=k=void 0,v=void 0,l=0.5>=m?m*(1+j):m+j-m*j;0===l?g="#000":(t=2*m-l,k=(l-t)/l,g*=6,n=Math.floor(g),
v=g-n,v*=l*k,0===n||6===n?(n=l,k=t+v,l=t):1===n?(n=l-v,k=l,l=t):2===n?(n=t,k=l,l=t+v):3===n?(n=t,k=l-v):4===n?(n=t+v,k=t):(n=l,k=t,l-=v),g="#"+N(n)+N(k)+N(l));b[e]=g}}h.compiledHeatmaps=y}f.container=s(document.createElement("div"),h.container);f.count=f.container.appendChild(s(document.createElement("div"),h.count));f.legend=f.container.appendChild(s(document.createElement("div"),h.legend));f.graph=d.graph?f.container.appendChild(s(document.createElement("div"),h.graph)):0;w.length=0;for(var q in f)f[q]&&
h[q].heatOn&&w.push({name:q,el:f[q]});u.length=0;if(f.graph){f.graph.style.width=d.history*h.column.width+(d.history-1)*h.column.spacing+"px";for(c=0;c<d.history;c++)u[c]=f.graph.appendChild(s(document.createElement("div"),h.column)),u[c].style.position="absolute",u[c].style.bottom=0,u[c].style.right=c*h.column.width+c*h.column.spacing+"px",u[c].style.width=h.column.width+"px",u[c].style.height="0px"}s(f.container,d);r();a.appendChild(f.container);f.graph&&(O=f.graph.clientHeight);d.toggleOn&&("click"===
d.toggleOn&&(f.container.style.cursor="pointer"),S(f.container,d.toggleOn,G))}"object"===H(a)&&a.nodeType===j&&(e=a,a=document.body);a||(a=document.body);var b=this,d=I({},D.defaults,e||{}),f={},u=[],h,y,J=100,w=[],W=0,B=d.threshold,Q=0,L=A()-B,z,E=[],F=[],x,P,q="fps"===d.show,O,K,c,p;b.options=d;b.fps=0;b.duration=0;b.isPaused=0;b.tickStart=function(){Q=A()};b.tick=function(){z=A();W=z-L;B+=(W-B)/d.smoothing;b.fps=1E3/B;b.duration=Q<L?B:z-Q;L=z};b.pause=function(){x&&(b.isPaused=1,clearTimeout(x),
C(x),C(P),x=P=0);return b};b.resume=function(){x||(b.isPaused=0,k());return b};b.set=function(a,c){d[a]=c;q="fps"===d.show;-1!==R(a,X)&&V();-1!==R(a,Y)&&s(f.container,d);return b};b.showDuration=function(){b.set("show","ms");return b};b.showFps=function(){b.set("show","fps");return b};b.toggle=function(){b.set("show",q?"ms":"fps");return b};b.hide=function(){b.pause();f.container.style.display="none";return b};b.show=function(){b.resume();f.container.style.display="block";return b};b.destroy=function(){b.pause();
U();b.tick=b.tickStart=function(){}};V();k()}var A,r=m.performance;A=r&&(r.now||r.webkitNow)?r[r.now?"now":"webkitNow"].bind(r):function(){return+new Date};for(var C=m.cancelAnimationFrame||m.cancelRequestAnimationFrame,M=m.requestAnimationFrame,r=["moz","webkit","o"],G=0,k=0,Z=r.length;k<Z&&!C;++k)M=(C=m[r[k]+"CancelAnimationFrame"]||m[r[k]+"CancelRequestAnimationFrame"])&&m[r[k]+"RequestAnimationFrame"];C||(M=function(a){var e=A(),g=Math.max(0,16-(e-G));G=e+g;return m.setTimeout(function(){a(e+
g)},g)},C=function(a){clearTimeout(a)});var T="string"===H(document.createElement("div").textContent)?"textContent":"innerText";D.extend=I;window.FPSMeter=D;D.defaults={interval:100,smoothing:10,show:"fps",toggleOn:"click",decimals:1,maxFps:60,threshold:100,position:"absolute",zIndex:10,left:"5px",top:"5px",right:"auto",bottom:"auto",margin:"0 0 0 0",theme:"dark",heat:0,graph:0,history:20};var X=["toggleOn","theme","heat","graph","history"],Y="position zIndex left top right bottom margin".split(" ")})(window);(function(m,j){j.theme={};var s=j.theme.base={heatmaps:[],container:{heatOn:null,heatmap:null,padding:"5px",minWidth:"95px",height:"30px",lineHeight:"30px",textAlign:"right",textShadow:"none"},count:{heatOn:null,heatmap:null,position:"absolute",top:0,right:0,padding:"5px 10px",height:"30px",fontSize:"24px",fontFamily:"Consolas, Andale Mono, monospace",zIndex:2},legend:{heatOn:null,heatmap:null,position:"absolute",top:0,left:0,padding:"5px 10px",height:"30px",fontSize:"12px",lineHeight:"32px",fontFamily:"sans-serif",
textAlign:"left",zIndex:2},graph:{heatOn:null,heatmap:null,position:"relative",boxSizing:"padding-box",MozBoxSizing:"padding-box",height:"100%",zIndex:1},column:{width:4,spacing:1,heatOn:null,heatmap:null}};j.theme.dark=j.extend({},s,{heatmaps:[{saturation:0.8,lightness:0.8}],container:{background:"#222",color:"#fff",border:"1px solid #1a1a1a",textShadow:"1px 1px 0 #222"},count:{heatOn:"color"},column:{background:"#3f3f3f"}});j.theme.light=j.extend({},s,{heatmaps:[{saturation:0.5,lightness:0.5}],
container:{color:"#666",background:"#fff",textShadow:"1px 1px 0 rgba(255,255,255,.5), -1px -1px 0 rgba(255,255,255,.5)",boxShadow:"0 0 0 1px rgba(0,0,0,.1)"},count:{heatOn:"color"},column:{background:"#eaeaea"}});j.theme.colorful=j.extend({},s,{heatmaps:[{saturation:0.5,lightness:0.6}],container:{heatOn:"backgroundColor",background:"#888",color:"#fff",textShadow:"1px 1px 0 rgba(0,0,0,.2)",boxShadow:"0 0 0 1px rgba(0,0,0,.1)"},column:{background:"#777",backgroundColor:"rgba(0,0,0,.2)"}});j.theme.transparent=
j.extend({},s,{heatmaps:[{saturation:0.8,lightness:0.5}],container:{padding:0,color:"#fff",textShadow:"1px 1px 0 rgba(0,0,0,.5)"},count:{padding:"0 5px",height:"40px",lineHeight:"40px"},legend:{padding:"0 5px",height:"40px",lineHeight:"42px"},graph:{height:"40px"},column:{width:5,background:"#999",heatOn:"backgroundColor",opacity:0.5}})})(window,FPSMeter);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,3 @@
/*! npm.im/iphone-inline-video */
var makeVideoPlayableInline=function(){"use strict";/*! npm.im/intervalometer */
function e(e,n,r,i){function t(r){d=n(t,i),e(r-(a||r)),a=r}var d,a;return{start:function(){d||t(0)},stop:function(){r(d),d=null,a=0}}}function n(n){return e(n,requestAnimationFrame,cancelAnimationFrame)}function r(e,n,r,i){function t(n){Boolean(e[r])===Boolean(i)&&n.stopImmediatePropagation(),delete e[r]}return e.addEventListener(n,t,!1),t}function i(e,n,r,i){function t(){return r[n]}function d(e){r[n]=e}i&&d(e[n]),Object.defineProperty(e,n,{get:t,set:d})}function t(e,n,r){r.addEventListener(n,function(){return e.dispatchEvent(new Event(n))})}function d(e,n){Promise.resolve().then(function(){e.dispatchEvent(new Event(n))})}function a(e){var n=new Audio;return t(e,"play",n),t(e,"playing",n),t(e,"pause",n),n.crossOrigin=e.crossOrigin,n.src=e.src||e.currentSrc||"data:",n}function o(e,n,r){(m||0)+200<Date.now()&&(e[g]=!0,m=Date.now()),r||(e.currentTime=n),A[++k%3]=100*n|0}function u(e){return e.driver.currentTime>=e.video.duration}function s(e){var n=this;n.video.readyState>=n.video.HAVE_FUTURE_DATA?(n.hasAudio||(n.driver.currentTime=n.video.currentTime+e*n.video.playbackRate/1e3,n.video.loop&&u(n)&&(n.driver.currentTime=0)),o(n.video,n.driver.currentTime)):n.video.networkState!==n.video.NETWORK_IDLE||n.video.buffered.length||n.video.load(),n.video.ended&&(delete n.video[g],n.video.pause(!0))}function c(){var e=this,n=e[b];return e.webkitDisplayingFullscreen?void e[E]():("data:"!==n.driver.src&&n.driver.src!==e.src&&(o(e,0,!0),n.driver.src=e.src),void(e.paused&&(n.paused=!1,e.buffered.length||e.load(),n.driver.play(),n.updater.start(),n.hasAudio||(d(e,"play"),n.video.readyState>=n.video.HAVE_ENOUGH_DATA&&d(e,"playing")))))}function v(e){var n=this,r=n[b];r.driver.pause(),r.updater.stop(),n.webkitDisplayingFullscreen&&n[T](),r.paused&&!e||(r.paused=!0,r.hasAudio||d(n,"pause"),n.ended&&(n[g]=!0,d(n,"ended")))}function p(e,r){var i=e[b]={};i.paused=!0,i.hasAudio=r,i.video=e,i.updater=n(s.bind(i)),r?i.driver=a(e):(e.addEventListener("canplay",function(){e.paused||d(e,"playing")}),i.driver={src:e.src||e.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,u(i)&&o(e,0)},get ended(){return u(i)}}),e.addEventListener("emptied",function(){var n=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==e.src&&(o(e,0,!0),i.driver.src=e.src,n?i.driver.play():i.updater.stop())},!1),e.addEventListener("webkitbeginfullscreen",function(){e.paused?r&&!i.driver.buffered.length&&i.driver.load():(e.pause(),e[E]())}),r&&(e.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=e.currentTime}),e.addEventListener("seeking",function(){A.indexOf(100*e.currentTime|0)<0&&(i.driver.currentTime=e.currentTime)}))}function l(e){var n=e[b];e[E]=e.play,e[T]=e.pause,e.play=c,e.pause=v,i(e,"paused",n.driver),i(e,"muted",n.driver,!0),i(e,"playbackRate",n.driver,!0),i(e,"ended",n.driver),i(e,"loop",n.driver,!0),r(e,"seeking"),r(e,"seeked"),r(e,"timeupdate",g,!1),r(e,"ended",g,!1)}function f(e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0),r&&!h||e[b]||(p(e,n),l(e),e.classList.add("IIV"),!n&&e.autoplay&&e.play(),/iPhone|iPod|iPad/.test(navigator.platform)||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var m,y="undefined"==typeof Symbol?function(e){return"@"+(e||"@")+Math.random()}:Symbol,h="object-fit"in document.head.style&&/iPhone|iPod/i.test(navigator.userAgent)&&!matchMedia("(-webkit-video-playable-inline)").matches,b=y(),g=y(),E=y("nativeplay"),T=y("nativepause"),A=[],k=0;return f.isWhitelisted=h,f}();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

398
www.eng/js/libs/pinyin.json Normal file
View file

@ -0,0 +1,398 @@
{
"a": "啊阿",
"ai": "埃挨哎唉哀皑癌蔼矮艾碍爱隘",
"an": "鞍氨安俺按暗岸胺案",
"ang": "肮昂盎",
"ao": "凹敖熬翱袄傲奥懊澳",
"ba": "芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸",
"bai": "白柏百摆佰败拜稗",
"ban": "斑班搬扳般颁板版扮拌伴瓣半办绊",
"bang": "邦帮梆榜膀绑棒磅蚌镑傍谤",
"bao": "苞胞包褒剥盄盇盉盋盌盓盕盙盚盜盝盞盠盡盢監盤盦盧盨盩盪盫盬盭盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎眏眐眑眒眓眔眕眖眗眘眛眜眝眞眡眣眤眥眧眪眫眬眮眰眱眲眳眴眹眻眽眾眿睂睄睅睆睈睉睊睋睌睍睎睏睒睓睔睕睖睗睘睙睜薄雹保堡饱宝抱报暴豹鲍爆",
"bei": "杯碑悲卑北辈背贝钡倍狈备惫焙被",
"ben": "奔苯本笨",
"beng": "崩绷甭泵蹦迸",
"bi": "逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛",
"bian": "鞭边编贬扁便变卞辨辩辫遍",
"biao": "标彪膘表",
"bie": "鳖憋别瘪",
"bin": "彬斌濒滨宾摈",
"bing": "兵冰柄丙秉饼炳 睝睞睠睤睧睩睪睭睮睯睰睱睲睳睴睵睶睷睸睺睻睼瞁瞂瞃瞆瞇瞈瞉瞊瞋瞏瞐瞓瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶瞷瞸瞹瞺瞼瞾矀矁矂矃矄矅矆矇矈矉矊矋矌矎矏矐矑矒矓矔矕矖矘矙矚矝矞矟矠矡矤病并",
"bo": "玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜",
"bu": "哺补埠不布步簿部怖",
"ca": "擦",
"cai": "猜裁材才财睬踩采彩菜蔡",
"can": "餐参蚕残惭惨灿",
"cang": "苍舱仓沧藏",
"cao": "操糙槽曹草",
"ce": "厕策侧册测",
"ceng": "层蹭",
"cha": "插叉茬茶查碴搽察岔差诧",
"chai": "拆柴豺",
"chan": "搀掺蝉馋谗缠铲产阐颤",
"chang": "昌猖 矦矨矪矰矱矲矴矵矷矹矺矻矼砃砄砅砆砇砈砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚硛硜硞硟硠硡硢硣硤硥硦硧硨硩硯硰硱硲硳硴硵硶硸硹硺硻硽硾硿碀碁碂碃场尝常长偿肠厂敞畅唱倡",
"chao": "超抄钞朝嘲潮巢吵炒",
"che": "车扯撤掣彻澈",
"chen": "郴臣辰尘晨忱沉陈趁衬",
"cheng": "撑称城橙成呈乘程惩澄诚承逞骋秤",
"chi": "吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽",
"chong": "充冲虫崇宠",
"chou": "抽酬畴踌稠愁筹仇绸瞅丑臭",
"chu": "初出橱厨躇锄雏滁除楚碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨碩碪碫碬碭碮碯碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚磛磜磝磞磟磠磡磢磣磤磥磦磧磩磪磫磭磮磯磰磱磳磵磶磸磹磻磼磽磾磿礀礂礃礄礆礇礈礉礊礋礌础储矗搐触处",
"chuai": "揣",
"chuan": "川穿椽传船喘串",
"chuang": "疮窗幢床闯创",
"chui": "吹炊捶锤垂",
"chun": "春椿醇唇淳纯蠢",
"chuo": "戳绰",
"ci": "疵茨磁雌辞慈瓷词此刺赐次",
"cong": "聪葱囱匆从丛",
"cou": "凑",
"cu": "粗醋簇促",
"cuan": "蹿篡窜",
"cui": "摧崔催脆瘁粹淬翠",
"cun": "村存寸",
"cuo": "磋撮搓措挫错",
"da": "搭达答瘩打大",
"dai": "呆歹傣戴带殆代贷袋待逮礍礎礏礐礑礒礔礕礖礗礘礙礚礛礜礝礟礠礡礢礣礥礦礧礨礩礪礫礬礭礮礯礰礱礲礳礵礶礷礸礹礽礿祂祃祄祅祇祊祋祌祍祎祏祐祑祒祔祕祘祙祡祣祤祦祩祪祫祬祮祰祱祲祳祴祵祶祹祻祼祽祾祿禂禃禆禇禈禉禋禌禍禎禐禑禒怠",
"dan": "耽担丹单郸掸胆旦氮但惮淡诞弹蛋",
"dang": "当挡党荡档",
"dao": "刀捣蹈倒岛祷导到稻悼道盗",
"de": "德得的",
"deng": "蹬灯登等瞪凳邓",
"di": "堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔",
"dian": "颠掂滇碘点典靛垫电佃甸店惦奠淀殿",
"diao": "碉叼雕凋刁掉吊钓调",
"die": "跌爹碟蝶迭谍叠禓禔禕禖禗禘禙禛禜禝禞禟禠禡禢禣禤禥禦禨禩禪禫禬禭禮禯禰禱禲禴禵禶禷禸禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙秚秛秜秝秞秠秡秢秥秨秪秬秮秱秲秳秴秵秶秷秹秺秼秾秿稁稄稅稇稈稉稊稌稏稐稑稒稓稕稖稘稙稛稜",
"ding": "丁盯叮钉顶鼎锭定订",
"diu": "丢",
"dong": "东冬董懂动栋侗恫冻洞",
"dou": "兜抖斗陡豆逗痘",
"du": "都督毒犊独读堵睹赌杜镀肚度渡妒",
"duan": "端短锻段断缎",
"dui": "堆兑队对",
"dun": "墩吨蹲敦顿囤钝盾遁",
"duo": "掇哆多夺垛躲朵跺舵剁惰堕",
"e": "蛾峨鹅俄额讹娥恶厄扼遏鄂饿",
"en": "恩",
"er": "而儿耳尔饵洱二稝稟稡稢稤稥稦稧稨稩稪稫稬稭種稯稰稱稲稴稵稶稸稺稾穀穁穂穃穄穅穇穈穉穊穋穌積穎穏穐穒穓穔穕穖穘穙穚穛穜穝穞穟穠穡穢穣穤穥穦穧穨穩穪穫穬穭穮穯穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰",
"fa": "发罚筏伐乏阀法珐",
"fan": "藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛",
"fang": "坊芳方肪房防妨仿访纺放",
"fei": "菲非啡飞肥匪诽吠肺废沸费",
"fen": "芬酚吩氛分纷坟焚汾粉奋份忿愤粪",
"feng": "丰封枫蜂峰锋风疯烽逢冯缝讽奉凤",
"fo": "佛",
"fou": "否",
"fu": "夫敷肤孵扶拂辐幅氟符伏俘服窣窤窧窩窪窫窮窯窰窱窲窴窵窶窷窸窹窺窻窼窽窾竀竁竂竃竄竅竆竇竈竉竊竌竍竎竏竐竑竒竓竔竕竗竘竚竛竜竝竡竢竤竧竨竩竪竫竬竮竰竱竲竳竴竵競竷竸竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐",
"ga": "噶嘎",
"gai": "该改概钙盖溉",
"gan": "干甘杆柑竿肝赶感秆敢赣",
"gang": "冈刚钢缸肛纲岗港杠",
"gao": "篙皋高膏羔糕搞镐稿告",
"ge": "哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各",
"gei": "给",
"gen": "根跟",
"geng": "耕更庚羹笯笰笲笴笵笶笷笹笻笽笿筀筁筂筃筄筆筈筊筍筎筓筕筗筙筜筞筟筡筣筤筥筦筧筨筩筪筫筬筭筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆箇箈箉箊箋箌箎箏箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹箺箻箼箽箾箿節篂篃範埂耿梗",
"gong": "工攻功恭龚供躬公宫弓巩汞拱贡共",
"gou": "钩勾沟苟狗垢构购够",
"gu": "辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇",
"gua": "刮瓜剐寡挂褂",
"guai": "乖拐怪",
"guan": "棺关官冠观管馆罐惯灌贯",
"guang": "光广逛",
"gui": "瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽",
"gun": "辊滚棍",
"guo": "锅郭国果裹过",
"ha": "哈篅篈築篊篋篍篎篏篐篒篔篕篖篗篘篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲篳篴篵篶篸篹篺篻篽篿簀簁簂簃簄簅簆簈簉簊簍簎簐簑簒簓簔簕簗簘簙簚簛簜簝簞簠簡簢簣簤簥簨簩簫簬簭簮簯簰簱簲簳簴簵簶簷簹簺簻簼簽簾籂",
"hai": "骸孩海氦亥害骇",
"han": "酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉",
"hang": "夯杭航",
"hao": "壕嚎豪毫郝好耗号浩",
"he": "呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺",
"hei": "嘿黑",
"hen": "痕很狠恨",
"heng": "哼亨横衡恒",
"hong": "轰哄烘虹鸿洪宏弘红",
"hou": "喉侯猴吼厚候后",
"hu": "呼乎忽瑚壶葫胡蝴狐糊湖籃籄籅籆籇籈籉籊籋籌籎籏籐籑籒籓籔籕籖籗籘籙籚籛籜籝籞籟籠籡籢籣籤籥籦籧籨籩籪籫籬籭籮籯籰籱籲籵籶籷籸籹籺籾籿粀粁粂粃粄粅粆粇粈粊粋粌粍粎粏粐粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴粵粶粷粸粺粻弧虎唬护互沪户",
"hua": "花哗华猾滑画划化话",
"huai": "槐徊怀淮坏",
"huan": "欢环桓还缓换患唤痪豢焕涣宦幻",
"huang": "荒慌黄磺蝗簧皇凰惶煌晃幌恍谎",
"hui": "灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘",
"hun": "荤昏婚魂浑混",
"huo": "豁活伙火获或惑霍货祸",
"ji": "击圾基机畸稽积箕粿糀糂糃糄糆糉糋糎糏糐糑糒糓糔糘糚糛糝糞糡糢糣糤糥糦糧糩糪糫糬糭糮糰糱糲糳糴糵糶糷糹糺糼糽糾糿紀紁紂紃約紅紆紇紈紉紋紌納紎紏紐紑紒紓純紕紖紗紘紙級紛紜紝紞紟紡紣紤紥紦紨紩紪紬紭紮細紱紲紳紴紵紶肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪",
"jia": "嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁",
"jian": "歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件 紷紸紹紺紻紼紾紿絀絁終絃組絅絆絇絈絉絊絋経絍絎絏結絑絒絓絔絕絖絗絘絙絚絛絜絝絞絟絠絡絢絣絤絥給絧絨絩絪絫絬絭絯絰統絲絳絴絵絶絸絹絺絻絼絽絾絿綀綁綂綃綄綅綆綇綈綉綊綋綌綍綎綏綐綑綒經綔綕綖綗綘健舰剑饯渐溅涧建",
"jiang": "僵姜将浆江疆蒋桨奖讲匠酱降",
"jiao": "蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖",
"jie": "揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届",
"jin": "巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸継続綛綜綝綞綟綠綡綢綣綤綥綧綨綩綪綫綬維綯綰綱網綳綴綵綶綷綸綹綺綻綼綽綾綿緀緁緂緃緄緅緆緇緈緉緊緋緌緍緎総緐緑緒緓緔緕緖緗緘緙線緛緜緝緞緟締緡緢緣緤緥緦緧編緩緪緫緬緭緮緯緰緱緲緳練緵緶緷緸緹緺尽劲",
"jing": "荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净",
"jiong": "炯窘",
"jiu": "揪究纠玖韭久灸九酒厩救旧臼舅咎就疚",
"ju": "鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧",
"juan": "捐鹃娟倦眷卷绢",
"jue": "撅攫抉掘倔爵觉决诀绝",
"jun": "均菌钧军君峻緻緼緽緾緿縀縁縂縃縄縅縆縇縈縉縊縋縌縍縎縏縐縑縒縓縔縕縖縗縘縙縚縛縜縝縞縟縠縡縢縣縤縥縦縧縨縩縪縫縬縭縮縯縰縱縲縳縴縵縶縷縸縹縺縼總績縿繀繂繃繄繅繆繈繉繊繋繌繍繎繏繐繑繒繓織繕繖繗繘繙繚繛繜繝俊竣浚郡骏",
"ka": "喀咖卡咯",
"kai": "开揩楷凯慨",
"kan": "刊堪勘坎砍看",
"kang": "康慷糠扛抗亢炕",
"kao": "考拷烤靠",
"ke": "坷苛柯棵磕颗科壳咳可渴克刻客课",
"ken": "肯啃垦恳",
"keng": "坑吭",
"kong": "空恐孔控",
"kou": "抠口扣寇",
"ku": "枯哭窟苦酷库裤",
"kua": "夸垮挎跨胯",
"kuai": "块筷侩快",
"kuan": "宽款",
"kuang": "匡筐狂框矿眶旷况",
"kui": "亏盔岿窥葵奎魁傀繞繟繠繡繢繣繤繥繦繧繨繩繪繫繬繭繮繯繰繱繲繳繴繵繶繷繸繹繺繻繼繽繾繿纀纁纃纄纅纆纇纈纉纊纋續纍纎纏纐纑纒纓纔纕纖纗纘纙纚纜纝纞纮纴纻纼绖绤绬绹缊缐缞缷缹缻缼缽缾缿罀罁罃罆罇罈罉罊罋罌罍罎罏罒罓馈愧溃",
"kun": "坤昆捆困",
"kuo": "括扩廓阔",
"la": "垃拉喇蜡腊辣啦邋",
"lai": "莱来赖",
"lan": "蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥",
"lang": "琅榔狼廊郎朗浪",
"lao": "捞劳牢老佬姥酪烙涝",
"le": "勒乐了",
"lei": "雷镭蕾磊累儡垒擂肋类泪",
"leng": "棱楞冷",
"li": "厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐罖罙罛罜罝罞罠罣罤罥罦罧罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂羃羄羅羆羇羈羉羋羍羏羐羑羒羓羕羖羗羘羙羛羜羠羢羣羥羦羨義羪羫羬羭羮羱羳羴羵羶羷羺羻羾翀翂翃翄翆翇翈翉翋翍翏翐翑習翓翖翗翙翚翛翜翝翞翢翣痢立粒沥隶力璃哩",
"lia": "俩",
"lian": "联莲连镰廉怜涟帘敛脸链恋炼练",
"liang": "粮凉梁粱良两辆量晾亮谅",
"liao": "撩聊僚疗燎寥辽潦撂镣廖料",
"lie": "列裂烈劣猎",
"lin": "琳林磷霖临邻鳞淋凛赁吝拎",
"ling": "玲菱零龄铃伶羚凌灵陵岭领另令",
"liu": "溜琉榴硫馏留刘瘤流柳六",
"long": "龙聋咙笼窿 翤翧翨翪翫翬翭翲翴翵翶翷翸翹翺翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫耬耭耮耯耰耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗聙聛聜聝聞聟聠聡聢聣聤聥聦聧聨聫聬聭聮聯聰聲聳聴聵聶職聸聹聺聻聼聽隆垄拢陇",
"lou": "楼娄搂篓漏陋",
"lu": "芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮",
"lv": "驴吕铝侣旅履屡缕虑氯律率滤绿",
"luan": "峦挛孪滦卵乱",
"lue": "掠略",
"lun": "抡轮伦仑沦纶论",
"luo": "萝螺罗逻锣箩骡裸落洛骆络",
"ma": "妈麻玛码蚂马骂嘛吗",
"mai": "埋买麦卖迈脉",
"man": "瞒馒蛮满蔓曼慢漫聾肁肂肅肈肊肍肎肏肐肑肒肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇胈胉胊胋胏胐胑胒胓胔胕胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋脌脕脗脙脛脜脝脟脠脡脢脣脤脥脦脧脨脩脪脫脭脮脰脳脴脵脷脹脺脻脼脽脿谩",
"mang": "芒茫盲氓忙莽",
"mao": "猫茅锚毛矛铆卯茂冒帽貌贸",
"me": "么",
"mei": "玫枚梅酶霉煤没眉媒镁每美昧寐妹媚",
"men": "门闷们",
"meng": "萌蒙檬盟锰猛梦孟",
"mi": "眯醚靡糜迷谜弥米秘觅泌蜜密幂",
"mian": "棉眠绵冕免勉娩缅面",
"miao": "苗描瞄藐秒渺庙妙",
"mie": "蔑灭",
"min": "民抿皿敏悯闽",
"ming": "明螟鸣铭名命",
"miu": "谬",
"mo": "摸腀腁腂腃腄腅腇腉腍腎腏腒腖腗腘腛腜腝腞腟腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃膄膅膆膇膉膋膌膍膎膐膒膓膔膕膖膗膙膚膞膟膠膡膢膤膥膧膩膫膬膭膮膯膰膱膲膴膵膶膷膸膹膼膽膾膿臄臅臇臈臉臋臍臎臏臐臑臒臓摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌",
"mou": "谋牟某",
"mu": "拇牡亩姆母墓暮幕募慕木目睦牧穆",
"na": "拿哪呐钠那娜纳",
"nai": "氖乃奶耐奈",
"nan": "南男难",
"nang": "囊",
"nao": "挠脑恼闹淖",
"ne": "呢",
"nei": "馁内",
"nen": "嫩",
"neng": "能",
"ni": "妮霓倪泥尼拟你匿腻逆溺",
"nian": "蔫拈年碾撵捻念",
"niang": "娘酿",
"niao": "鸟尿",
"nie": "捏聂孽啮镊镍涅",
"nin": "您",
"ning": "柠狞凝宁 臔臕臖臗臘臙臛臜臝臞臟臠臡臢臤臥臦臨臩臫臮臯臰臱臲臵臶臷臸臹臺臽臿舃與興舉舊舋舎舏舑舓舕舖舗舘舙舚舝舠舤舥舦舧舩舮舲舺舼舽舿艀艁艂艃艅艆艈艊艌艍艎艐艑艒艓艔艕艖艗艙艛艜艝艞艠艡艢艣艤艥艦艧艩拧泞",
"niu": "牛扭钮纽",
"nong": "脓浓农弄",
"nu": "奴努怒",
"nv": "女",
"nuan": "暖",
"nue": "虐疟",
"nuo": "挪懦糯诺",
"o": "哦",
"ou": "欧鸥殴藕呕偶沤",
"pa": "啪趴爬帕怕琶",
"pai": "拍排牌徘湃派",
"pan": "攀潘盘磐盼畔判叛",
"pang": "乓庞旁耪胖",
"pao": "抛咆刨炮袍跑泡",
"pei": "呸胚培裴赔陪配佩沛",
"pen": "喷盆",
"peng": "砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰",
"pi": "坯砒霹批披劈琵毗艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸苺苼苽苾苿茀茊茋茍茐茒茓茖茘茙茝茞茟茠茡茢茣茤茥茦茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬",
"pian": "篇偏片骗",
"piao": "飘漂瓢票",
"pie": "撇瞥",
"pin": "拼频贫品聘",
"ping": "乒坪苹萍平凭瓶评屏",
"po": "坡泼颇婆破魄迫粕剖",
"pu": "扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑",
"qi": "期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫",
"qia": "掐茾茿荁荂荄荅荈荊荋荌荍荎荓荕荖荗荘荙荝荢荰荱荲荳荴荵荶荹荺荾荿莀莁莂莃莄莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡莢莣莤莥莦莧莬莭莮莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽",
"qian": "牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉",
"qiang": "枪呛腔羌墙蔷强抢",
"qiao": "橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍",
"qie": "切茄且怯窃",
"qin": "钦侵亲秦琴勤芹擒禽寝沁",
"qing": "蜻青轻氢倾卿清擎晴氰情顷请庆",
"qiong": "琼穷",
"qiu": "秋丘邱球求囚酋泅",
"qu": "趋区蛆曲躯屈驱渠菮華菳菴菵菶菷菺菻菼菾菿萀萂萅萇萈萉萊萐萒萓萔萕萖萗萙萚萛萞萟萠萡萢萣萩萪萫萬萭萮萯萰萲萳萴萵萶萷萹萺萻萾萿葀葁葂葃葄葅葇葈葉葊葋葌葍葎葏葐葒葓葔葕葖葘葝葞葟葠葢葤葥葦葧葨葪葮葯葰葲葴葷葹葻葼取娶龋趣去",
"quan": "圈颧权醛泉全痊拳犬券劝",
"que": "缺炔瘸却鹊榷确雀",
"qun": "裙群",
"ran": "然燃冉染",
"rang": "瓤壤攘嚷让",
"rao": "饶扰绕",
"re": "惹热",
"ren": "壬仁人忍韧任认刃妊纫",
"reng": "扔仍",
"ri": "日",
"rong": "戎茸蓉荣融熔溶容绒冗",
"rou": "揉柔肉",
"ru": "茹蠕儒孺如辱乳汝入褥",
"ruan": "软阮",
"rui": "蕊瑞锐",
"run": "闰润",
"ruo": "若弱",
"sa": "撒洒萨",
"sai": "腮鳃塞赛",
"san": "三叁葽葾葿蒀蒁蒃蒄蒅蒆蒊蒍蒏蒐蒑蒒蒓蒔蒕蒖蒘蒚蒛蒝蒞蒟蒠蒢蒣蒤蒥蒦蒧蒨蒩蒪蒫蒬蒭蒮蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗蓘蓙蓚蓛蓜蓞蓡蓢蓤蓧蓨蓩蓪蓫蓭蓮蓯蓱蓲蓳蓴蓵蓶蓷蓸蓹蓺蓻蓽蓾蔀蔁蔂伞散",
"sang": "桑嗓丧",
"sao": "搔骚扫嫂",
"se": "瑟色涩",
"sen": "森",
"seng": "僧",
"sha": "莎砂杀刹沙纱傻啥煞",
"shai": "筛晒",
"shan": "珊苫杉山删煽衫闪陕擅赡膳善汕扇缮",
"shang": "墒伤商赏晌上尚裳",
"shao": "梢捎稍烧芍勺韶少哨邵绍",
"she": "奢赊蛇舌舍赦摄射慑涉社设",
"shen": "砷申呻伸身深娠绅神沈审婶甚肾慎渗",
"sheng": "声生甥牲升绳 蔃蔄蔆蔇蔈蔉蔊蔋蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢蔣蔤蔥蔦蔧蔨蔩蔪蔭蔮蔯蔰蔱蔲蔳蔴蔵蔶蔾蔿蕀蕁蕂蕄蕅蕆蕇蕋蕌蕍蕎蕏蕐蕑蕒蕓蕔蕕蕗蕘蕚蕛蕜蕝蕟蕠蕡蕢蕣蕥蕦蕧蕩蕪蕫蕬蕭蕮蕯蕰蕱蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣",
"shi": "师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试",
"shou": "收手首守寿授售受瘦兽",
"shu": "蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱薂薃薆薈薉薊薋薌薍薎薐薑薒薓薔薕薖薗薘薙薚薝薞薟薠薡薢薣薥薦薧薩薫薬薭薱薲薳薴薵薶薸薺薻薼薽薾薿藀藂藃藄藅藆藇藈藊藋藌藍藎藑藒藔藖藗藘藙藚藛藝藞藟藠藡藢藣藥藦藧藨藪藫藬藭藮藯藰藱藲藳藴藵藶藷藸恕",
"shua": "刷耍",
"shuai": "摔衰甩帅",
"shuan": "栓拴",
"shuang": "霜双爽",
"shui": "谁水睡税",
"shun": "吮瞬顺舜",
"shuo": "说硕朔烁",
"si": "斯撕嘶思私司丝死肆寺嗣四伺似饲巳",
"song": "松耸怂颂送宋讼诵",
"sou": "搜艘擞",
"su": "嗽苏酥俗素速粟僳塑溯宿诉肃",
"suan": "酸蒜算",
"sui": "虽隋随绥髓碎岁穗遂隧祟",
"sun": "孙损笋",
"suo": "蓑梭唆缩琐索锁所",
"ta": "遢塌他它她塔藹藺藼藽藾蘀蘁蘂蘃蘄蘆蘇蘈蘉蘊蘋蘌蘍蘎蘏蘐蘒蘓蘔蘕蘗蘘蘙蘚蘛蘜蘝蘞蘟蘠蘡蘢蘣蘤蘥蘦蘨蘪蘫蘬蘭蘮蘯蘰蘱蘲蘳蘴蘵蘶蘷蘹蘺蘻蘽蘾蘿虀虁虂虃虄虅虆虇虈虉虊虋虌虒虓處虖虗虘虙虛虜虝號虠虡虣虤虥虦虧虨虩虪獭挞蹋踏",
"tai": "胎苔抬台泰酞太态汰",
"tan": "坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭",
"tang": "汤塘搪堂棠膛唐糖倘躺淌趟烫",
"tao": "掏涛滔绦萄桃逃淘陶讨套",
"te": "特",
"teng": "藤腾疼誊",
"ti": "梯剔踢锑提题蹄啼体替嚏惕涕剃屉",
"tian": "天添填田甜恬舔腆",
"tiao": "挑条迢眺跳",
"tie": "贴铁帖",
"ting": "蜓厅听烃虭虯虰虲虳虴虵虷虸蚃蚄蚅蚆蚇蚈蚉蚎蚏蚐蚑蚒蚔蚖蚗蚘蚙蚚蚛蚞蚟蚠蚡蚢蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻蚼蚽蚾蚿蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇",
"tong": "通桐酮瞳同铜彤童桶捅筒统痛",
"tou": "偷投头透",
"tu": "凸秃突图徒途涂屠土吐兔",
"tuan": "湍团",
"tui": "推颓腿蜕褪退",
"tun": "吞屯臀",
"tuo": "拖托脱鸵陀驮驼椭妥拓唾",
"wa": "挖哇蛙洼娃瓦袜",
"wai": "歪外",
"wan": "豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕",
"wang": "汪王亡枉网往旺望忘妄",
"wei": "威蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀蝁蝂蝃蝄蝅蝆蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚蝛蝜蝝蝞蝟蝡蝢蝦蝧蝨蝩蝪蝫蝬蝭蝯蝱蝲蝳蝵蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎螏螐螑螒螔螕螖螘螙螚螛螜螝螞螠螡螢螣螤巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫",
"wen": "瘟温蚊文闻纹吻稳紊问",
"weng": "嗡翁瓮",
"wo": "挝蜗涡窝我斡卧握沃",
"wu": "巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误",
"xi": "昔熙析西硒矽晰嘻吸锡牺螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁蟂蟃蟄蟅蟇蟈蟉蟌蟍蟎蟏蟐蟔蟕蟖蟗蟘蟙蟚蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯蟰蟱蟲蟳蟴蟵蟶蟷蟸蟺蟻蟼蟽蟿蠀蠁蠂蠄蠅蠆蠇蠈蠉蠋蠌蠍蠎蠏蠐蠑蠒蠔蠗蠘蠙蠚蠜蠝蠞蠟蠠蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细",
"xia": "瞎虾匣霞辖暇峡侠狭下厦夏吓",
"xian": "掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线",
"xiang": "相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象",
"xiao": "萧硝霄削哮嚣销消宵淆晓蠤蠥蠧蠨蠩蠪蠫蠬蠭蠮蠯蠰蠱蠳蠴蠵蠶蠷蠸蠺蠻蠽蠾蠿衁衂衃衆衇衈衉衊衋衎衏衐衑衒術衕衖衘衚衛衜衝衞衟衠衦衧衪衭衯衱衳衴衵衶衸衹衺衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗袘袙袚袛袝袞袟袠袡袣袥袦袧袨袩袪小孝校肖啸笑效",
"xie": "楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑",
"xin": "薪芯锌欣辛新忻心信衅",
"xing": "星腥猩惺兴刑型形邢行醒幸杏性姓",
"xiong": "兄凶胸匈汹雄熊",
"xiu": "休修羞朽嗅锈秀袖绣",
"xu": "墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续",
"xuan": "轩喧宣悬旋玄 袬袮袯袰袲袴袵袶袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚裛補裝裞裠裡裦裧裩裪裫裬裭裮裯裲裵裶裷裺裻製裿褀褁褃褄褅褆複褈褉褋褌褍褎褏褑褔褕褖褗褘褜褝褞褟褠褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚",
"xue": "靴薛学穴雪血",
"xun": "勋熏循旬询寻驯巡殉汛训讯逊迅",
"ya": "压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶",
"yan": "焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验",
"yang": "殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾",
"yao": "邀腰妖瑶褸褹褺褻褼褽褾褿襀襂襃襅襆襇襈襉襊襋襌襍襎襏襐襑襒襓襔襕襖襗襘襙襚襛襜襝襠襡襢襣襤襥襧襨襩襪襫襬襭襮襯襰襱襲襳襴襵襶襷襸襹襺襼襽襾覀覂覄覅覇覈覉覊見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡摇尧遥窑谣姚咬舀药要耀",
"ye": "椰噎耶爷野冶也页掖业叶曳腋夜液",
"yi": "一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎",
"yin": "茵荫因殷音阴姻吟银淫寅饮尹引隐覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽覾覿觀觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴觵觶觷觸觹觺觻觼觽觾觿訁訂訃訄訅訆計訉訊訋訌訍討訏訐訑訒訓訔訕訖託記訙訚訛訜訝印",
"ying": "英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映",
"yo": "哟",
"yong": "拥佣臃痈庸雍踊蛹咏泳涌永恿勇用",
"you": "幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂",
"yu": "淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉訞訟訠訡訢訣訤訥訦訧訨訩訪訫訬設訮訯訰許訲訳訴訵訶訷訸訹診註証訽訿詀詁詂詃詄詅詆詇詉詊詋詌詍詎詏詐詑詒詓詔評詖詗詘詙詚詛詜詝詞詟詠詡詢詣詤詥試詧詨詩詪詫詬詭詮詯詰話該詳詴詵詶詷詸詺詻詼詽詾詿誀浴寓裕预豫驭",
"yuan": "鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院",
"yue": "曰约越跃钥岳粤月悦阅",
"yun": "耘云郧匀陨允运蕴酝晕韵孕",
"za": "匝砸杂",
"zai": "栽哉灾宰载再在",
"zan": "咱攒暂赞",
"zang": "赃脏葬",
"zao": "遭糟凿藻枣早澡蚤躁噪造皂灶燥",
"ze": "责择则泽",
"zei": "贼",
"zen": "怎",
"zeng": "增憎曾赠",
"zha": "扎喳渣札轧誁誂誃誄誅誆誇誈誋誌認誎誏誐誑誒誔誕誖誗誘誙誚誛誜誝語誟誠誡誢誣誤誥誦誧誨誩說誫説読誮誯誰誱課誳誴誵誶誷誸誹誺誻誼誽誾調諀諁諂諃諄諅諆談諈諉諊請諌諍諎諏諐諑諒諓諔諕論諗諘諙諚諛諜諝諞諟諠諡諢諣铡闸眨栅榨咋乍炸诈",
"zhai": "摘斋宅窄债寨",
"zhan": "瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽",
"zhang": "樟章彰漳张掌涨杖丈帐账仗胀瘴障",
"zhao": "招昭找沼赵照罩兆肇召",
"zhe": "遮折哲蛰辙者锗蔗这浙",
"zhen": "珍斟真甄砧臻贞针侦枕疹诊震振镇阵",
"zheng": "蒸挣睁征狰争怔整拯正政諤諥諦諧諨諩諪諫諬諭諮諯諰諱諲諳諴諵諶諷諸諹諺諻諼諽諾諿謀謁謂謃謄謅謆謈謉謊謋謌謍謎謏謐謑謒謓謔謕謖謗謘謙謚講謜謝謞謟謠謡謢謣謤謥謧謨謩謪謫謬謭謮謯謰謱謲謳謴謵謶謷謸謹謺謻謼謽謾謿譀譁譂譃譄譅帧症郑证",
"zhi": "芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒",
"zhong": "中盅忠钟衷终种肿重仲众",
"zhou": "舟周州洲诌粥轴肘帚咒皱宙昼骤",
"zhu": "珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑譆譇譈證譊譋譌譍譎譏譐譑譒譓譔譕譖譗識譙譚譛譜譝譞譟譠譡譢譣譤譥譧譨譩譪譫譭譮譯議譱譲譳譴譵譶護譸譹譺譻譼譽譾譿讀讁讂讃讄讅讆讇讈讉變讋讌讍讎讏讐讑讒讓讔讕讖讗讘讙讚讛讜讝讞讟讬讱讻诇诐诪谉谞住注祝驻",
"zhua": "抓爪",
"zhuai": "拽",
"zhuan": "专砖转撰赚篆",
"zhuang": "桩庄装妆撞壮状",
"zhui": "椎锥追赘坠缀",
"zhun": "谆准",
"zhuo": "捉拙卓桌琢茁酌啄着灼浊",
"zi": "兹咨资姿滋淄孜紫仔籽滓子自渍字",
"zong": "鬃棕踪宗综总纵",
"zou": "邹走奏揍",
"zu": "租足卒族祖诅阻组",
"zuan": "钻纂",
"zui": "嘴醉最罪",
"zun": "尊遵",
"zuo": "昨左佐柞做作坐座"
}

View file

@ -0,0 +1,428 @@
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

View file

@ -0,0 +1,887 @@
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.eng/js/libs/pixi.js Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

6
www.eng/js/libs/trmix.min.js vendored Normal file
View file

@ -0,0 +1,6 @@
/* Type Rendering Mix JS - (c) 2013-2014 Tim Brown, Bram Stein. License: new BSD */(function(){'use strict';var b=window;function c(a){var f=d,g;a:{g=f.className.split(/\s+/);for(var n=0,H=g.length;n<H;n+=1)if(g[n]===a){g=!0;break a}g=!1}g||(f.className+=(""===f.className?"":" ")+a)};function e(a,f,g){this.b=null!=a?a:null;this.c=null!=f?f:null;this.g=null!=g?g:null}var h=/^([0-9]+)(?:[\._-]([0-9]+))?(?:[\._-]([0-9]+))?(?:[\._+-]?(.*))?$/;e.prototype.compare=function(a){return this.b>a.b||this.b===a.b&&this.c>a.c||this.b===a.b&&this.c===a.c&&this.g>a.g?1:this.b<a.b||this.b===a.b&&this.c<a.c||this.b===a.b&&this.c===a.c&&this.g<a.g?-1:0};function k(a,f){return 0===a.compare(f)||1===a.compare(f)}
function l(){var a=h.exec(m[1]),f=null,g=null,n=null;a&&(null!==a[1]&&a[1]&&(f=parseInt(a[1],10)),null!==a[2]&&a[2]&&(g=parseInt(a[2],10)),null!==a[3]&&a[3]&&(n=parseInt(a[3],10)));return new e(f,g,n)};function p(){var a=q;return 3===a.a||7===a.a||6===a.a||9===a.a||8===a.a||5===a.a?"grayscale":1===a.a&&k(a.d,new e(6,2))&&1===a.e?"grayscale":"unknown"};var q,r=b.navigator.userAgent,s=0,t=new e,u=0,v=new e,m=null;if(m=/(?:iPod|iPad|iPhone).*? OS ([\d_]+)/.exec(r))u=3,v=l();else if(m=/(?:BB\d{2}|BlackBerry).*?Version\/([^\s]*)/.exec(r))u=9,v=l();else if(m=/Android ([^;)]+)|Android/.exec(r))u=5,v=l();else if(m=/Windows Phone(?: OS)? ([^;)]+)/.exec(r))u=8,v=l();else if(m=/Linux ([^;)]+)|Linux/.exec(r))u=4,v=l();else if(m=/OS X ([^;)]+)/.exec(r))u=2,v=l();else if(m=/Windows NT ([^;)]+)/.exec(r))u=1,v=l();else if(m=/CrOS ([^;)]+)/.exec(r))u=6,v=l();
if(m=/MSIE ([\d\w\.]+)/.exec(r))s=1,t=l();else if(m=/Trident.*rv:([\d\w\.]+)/.exec(r))s=1,t=l();else if(m=/OPR\/([\d.]+)/.exec(r))s=4,t=l();else if(m=/Opera Mini.*Version\/([\d\.]+)/.exec(r))s=4,t=l();else if(m=/Opera(?: |.*Version\/|\/)([\d\.]+)/.exec(r))s=4,t=l();else if(m=/Firefox\/([\d\w\.]+)|Firefox/.exec(r))s=3,t=l();else if(m=/(?:Chrome|CrMo|CriOS)\/([\d\.]+)/.exec(r))s=2,t=l();else if(m=/Silk\/([\d\._]+)/.exec(r))s=7,t=l();else if(5===u||9===u)s=6;else if(m=/Version\/([\d\.\w]+).*Safari/.exec(r))s=
5,t=l();q=new function(a,f,g,n){this.e=a;this.f=f;this.a=g;this.d=n}(s,t,u,v);var w,x;
if(1===q.a){var y;if(2===q.e)y=k(q.f,new e(37))&&k(q.d,new e(6,1))?"directwrite":"gdi";else{var z;if(4===q.e)z=k(q.f,new e(24))&&k(q.d,new e(6,1))?"directwrite":"gdi";else{var A;if(-1===q.d.compare(new e(6,0)))A="gdi";else{var B;if(k(q.d,new e(6,0))){var C;if(C=1===q.e){var D=q.f,E=new e(8,0);C=0===D.compare(E)||-1===D.compare(E)}B=C?"gdi":"directwrite"}else B="unknown";A=B}z=A}y=z}x=y}else x=8===q.a?"directwrite":2===q.a||3===q.a?"coretext":5===q.a||4===q.a||6===q.a||7===q.a||9===q.a?"freetype":
"unknown";w=x;var F=p(),G,I=p();G="unknown"!==I?I:2===q.a||4===q.a?"subpixel":1===q.a?k(q.d,new e(6,0))?"subpixel":1===q.e?k(q.f,new e(7,0))?"subpixel":"grayscale":"subpixel":"unknown";var d=b.document.documentElement;c("tr-"+w);"unknown"===F&&"unknown"!==G&&(F+="-"+G);c("tr-aa-"+F);}());

3875
www.eng/js/libs/yaml.js Normal file

File diff suppressed because it is too large Load diff

9
www.eng/js/main.js Normal file
View file

@ -0,0 +1,9 @@
//=============================================================================
// main.js
//=============================================================================
PluginManager.setup($plugins);
window.onload = function() {
SceneManager.run(Scene_Boot);
};

4226
www.eng/js/plugins.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,6 @@
//=============================================================================
/*:
* @plugindesc ------------------------------------------------------------
* @author Yanfly Engine Plugins
*/
//=============================================================================

View file

@ -0,0 +1,100 @@
/*=============================================================================
* Tileset Properties as Regions
//=============================================================================
/*:
* @plugindesc <AEL_TilesetPropertyRegions> Uses regions to add tile properties.
* @author Archeia
*
* @param Ladder Region
* @desc Region used for Ladder Tiles.
* @default 2
*
* @param Counter Region
* @desc Region used for Counter Tiles.
* @default 3
*
* @param Damage Floor Region
* @desc Region used for Damage Tiles.
* @default 4
*
* @param Bush Region
* @desc Region used for Bush Tiles.
* @default 5
*
* @param Bush Height
* @desc Region used for Bush Tiles.
* @default 12
*
* @help This plugin adds tile properties like Ladder, Bush, Counter and Damage
* Floor to regions. This plugin also does not have any plugin commands.
*/
var Imported = Imported || {};
Imported.AEL_TilesetPropertyRegions = true;
//=============================================================================
// ** Parameter Check
//=============================================================================
var parameters = $plugins.filter(function(p) {
return p.description.contains('<AEL_TilesetPropertyRegions>') })[0].parameters;
//=============================================================================
// ** Set Parameters
//=============================================================================
var AEL = AEL || {};
AEL.TilesetPropertyRegions = AEL.TilesetPropertyRegions || {};
AEL.TilesetPropertyRegions.ladderRegion = Number(parameters['Ladder Region'] || 2);
AEL.TilesetPropertyRegions.counterRegion = Number(parameters['Counter Region'] || 3);
AEL.TilesetPropertyRegions.damageFloorRegion = Number(parameters['Damage Floor Region'] || 4);
AEL.TilesetPropertyRegions.bushRegion = Number(parameters['Bush Region'] || 5);
AEL.TilesetPropertyRegions.bushHeight = Number(parameters['Bush Height'] || 12);
//=============================================================================
// ** Game_Map
//-----------------------------------------------------------------------------
// The game object class for a map. It contains scrolling and passage
// determination functions.
//=============================================================================
// * Determine if Ladder
//=============================================================================
Game_Map.prototype.isLadder = function(x, y) {
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x20) || this.regionId(x, y) === AEL.TilesetPropertyRegions.ladderRegion);
};
//=============================================================================
// * Determine if Counter
//=============================================================================
Game_Map.prototype.isCounter = function(x, y) {
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x80) || this.regionId(x, y) === AEL.TilesetPropertyRegions.counterRegion);
};
//=============================================================================
// * Determine if Damage floor
//=============================================================================
Game_Map.prototype.isDamageFloor = function(x, y) {
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x100) || this.regionId(x, y) === AEL.TilesetPropertyRegions.damageFloorRegion);
};
//=============================================================================
// * Determine if Bush
//=============================================================================
Game_Map.prototype.isBush = function(x, y) {
if(Imported.YED_Tiled){ // Add Compatibility with Tiled
// Check if on Region
var onRegion = this._regions !== undefined && this.regionId(x, y) === AEL.TilesetPropertyRegions.bushRegion;
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x40) || onRegion)
} else {
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x40) || this.regionId(x, y) === AEL.TilesetPropertyRegions.bushRegion);
}
};
//=============================================================================
// * Change Bush Depth
//=============================================================================
Game_CharacterBase.prototype.refreshBushDepth = function() {
if (this.isNormalPriority() && !this.isObjectCharacter() &&
this.isOnBush() && !this.isJumping()) {
if (!this.isMoving()) {
this._bushDepth = AEL.TilesetPropertyRegions.bushHeight;
}
} else {
this._bushDepth = 0;
}
};

View file

@ -0,0 +1,708 @@
//=============================================================================
// TDS Active Chain Skills
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_ActiveChainSkills = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.ActiveChainSkills = _TDS_.ActiveChainSkills || {};
//=============================================================================
/*:
* @author TDS
* @plugindesc
* This script allows you to chain skills in a combo.
*
* @param Minimun Time
* @desc How many frames minimum for chain allowance.
* @default 120
* @param Title Text
* @desc Text displayed above the active chain skills as a title.
* @default Active Chain Skills
* @param Title Font Size
* @desc Font size of the title text of active chain skills.
* @default 20
* @param Active Skill Sound
* @desc Sound effect played whenever an active chain skill has been selected.
* @default {"name": "Skill2", "pan": 0, "pitch": 100, "volume": 80}
*
******************************************************************************
* @param * Chain Input Text *
******************************************************************************
* @param () Up Skill ON
* @desc
* @default \C[17]\C[0]Chain:
*
* @param () Up Skill OFF
* @desc
* @default \C[7]Chain:
*
* @param () Up Skill ACT
* @desc
* @default \C[17]Chain:
*
******************************************************************************
*
* @param () Down Skill ON
* @desc
* @default \C[17]\C[0]Chain:
*
* @param () Down Skill OFF
* @desc
* @default \C[7]Chain:
*
* @param () Down Skill ACT
* @desc
* @default \C[17]Chain:
*
******************************************************************************
*
* @param () Left Skill ON
* @desc
* @default \C[17]\C[0]Attack:
*
* @param () Left Skill OFF
* @desc
* @default \C[7]Attack:
*
* @param () Left Skill ACT
* @desc
* @default \C[17]Attack:
*
******************************************************************************
*
* @param () Right Skill ON
* @desc
* @default \C[17]\C[0]Strike:
*
* @param () Right Skill OFF
* @desc
* @default \C[7]Strike:
*
* @param () Right Skill ACT
* @desc
* @default \C[17]Strike:
*
******************************************************************************
* @help
*-----------------------------------------------------------------------------
* * Skill Notetags - These notetags go in the skill notebox in the database.
*-----------------------------------------------------------------------------
* <ChainSkill: SkillId, Input>
* ^ This note tag allows you to set which skills can be chained to the one
* that has this note tag. Order in the notes reflects order of choice.
* ^ SkillId: Id of the skill that can be chained into.
* ^ Input: Name of the Input. (up, down, left, right, ok, cancel, control, tab, etc..)
*
* Examples:
* <ChainSkill: 15, up>
* <ChainSkill: 16, down>
* <ChainSkill: 17, left>
* <ChainSkill: 18, right>
*
* <ChainOnly> (Case Sensitive.)
* ^ This makes the skill only usable only in chains. (Does not affect enemies.)
*/
//=============================================================================
// Get Plugin Parameters
var parameters = PluginManager.parameters('Active Chain Skills');
// Initialize Parameters
_TDS_.ActiveChainSkills.params = {};
// Get Chain Title
_TDS_.ActiveChainSkills.params.chainTitle = String(parameters['Title Text'] || 'Active Chain Skills');
// Get Chain Title Font Size
_TDS_.ActiveChainSkills.params.titleFontSize = Number(parameters['Title Font Size'] ||20);
// Get Minimun Input time (In Frames)
_TDS_.ActiveChainSkills.params.minimunInputTime = Number(parameters['Minimun Time'] || 120);
// Get Active Skill Sound
_TDS_.ActiveChainSkills.params.activeSkillSound = JsonEx.parse(parameters['Active Skill Sound'] || '{"name": "Skill2", "pan": 0, "pitch": 100, "volume": 80}' );
// Initialize Input Data
_TDS_.ActiveChainSkills.params.inputData = {up: {}, down: {}, left: {}, right: {}};
// Up Data
_TDS_.ActiveChainSkills.params.inputData.up.on = String(parameters['(↑) Up Skill ON'] || '\\C[17]↑\\C[0]Chain: ');
_TDS_.ActiveChainSkills.params.inputData.up.off = String(parameters['(↑) Up Skill OFF'] || '\\C[7]↑Chain: ');
_TDS_.ActiveChainSkills.params.inputData.up.act = String(parameters['(↑) Up Skill ACT'] || '\\C[17]↑Chain: ');
// Down Data
_TDS_.ActiveChainSkills.params.inputData.down.on = String(parameters['(↓) Down Skill ON'] || '\\C[17]↓\\C[0]Chain: ');
_TDS_.ActiveChainSkills.params.inputData.down.off = String(parameters['(↓) Down Skill OFF'] || '\\C[7]↓Chain: ');
_TDS_.ActiveChainSkills.params.inputData.down.act = String(parameters['(↓) Down Skill ACT'] || '\\C[17]↓Chain: ');
// Left Data
_TDS_.ActiveChainSkills.params.inputData.left.on = String(parameters['(←) Left Skill ON'] || '\\C[17]←\\C[0]Chain: ');
_TDS_.ActiveChainSkills.params.inputData.left.off = String(parameters['(←) Left Skill OFF'] || '\\C[7]←Chain: ');
_TDS_.ActiveChainSkills.params.inputData.left.act = String(parameters['(←) Left Skill ACT'] || '\\C[17]←Chain: ');
// Right Data
_TDS_.ActiveChainSkills.params.inputData.right.on = String(parameters['(→) Right Skill ON'] || '\\C[17]→\\C[0]Chain: ');
_TDS_.ActiveChainSkills.params.inputData.right.off = String(parameters['(→) Right Skill OFF'] || '\\C[7]→Chain: ');
_TDS_.ActiveChainSkills.params.inputData.right.act = String(parameters['(→) Right Skill ACT'] || '\\C[17]→Chain: ');
//=============================================================================
// ** DataManager
//-----------------------------------------------------------------------------
// The static class that manages the database and game objects.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.DataManager_onLoad = DataManager.onLoad;
//=============================================================================
// * On Load Processing
//=============================================================================
DataManager.onLoad = function(object) {
// Run Original Function
_TDS_.ActiveChainSkills.DataManager_onLoad.call(this, object);
// Set Array & Type
var array = object, type = null;
// Object Switch
switch (object) {
case $dataSkills: type = 'SKILL' ;break;
}
// If Type is not null
if (type !== null) {
// If Array is an array
if (Array.isArray(array)) {
// Go Through Array
for (var i = 0; i < array.length; i++) {
// Get Data
var data = array[i];
// Extract MetaData
if (data) { this.extractActiveChainSkillMetaData(data, type); }
}
}
}
};
//=============================================================================
// * Extract Active Chain Skill Meta Data
//=============================================================================
DataManager.extractActiveChainSkillMetaData = function(data, type) {
// If Data has no notes return
if (data.note.length <= 0) { return; }
// If Type is skill
if (type === 'SKILL') {
// Initialize Chain Skill List
data.meta.chainSkillList = {};
// Get Regular Expression
var regExp = /<ChainSkill:(.+),(.+)>/ig;
var str = data.note, arr;
while ((arr = regExp.exec(str)) !== null) {
// Set Parameter Swap Values
data.meta.chainSkillList[arr[2].trim()] = Number(arr[1]);
}
}
};
//=============================================================================
// ** DataManager
//-----------------------------------------------------------------------------
// The static class that manages the database and game objects.
//=============================================================================
// * Set Active Chain Skill Window
//=============================================================================
BattleManager.setActiveChainSkillWindow = function(chainWindow) { this._activeChainSkillWindow = chainWindow; };
//=============================================================================
// ** Game_BattlerBase
//-----------------------------------------------------------------------------
// The superclass of Game_Battler. It mainly contains parameters calculation.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.Game_BattlerBase_meetsSkillConditions = Game_BattlerBase.prototype.meetsSkillConditions;
//=============================================================================
// * Determine if Skill Meets Use Conditions
//=============================================================================
Game_BattlerBase.prototype.meetsSkillConditions = function(skill) {
// Return false if Chain skill is restricted
if (this.isChainSkillRestrict(skill)) { return false; }
// Return Original Function
return _TDS_.ActiveChainSkills.Game_BattlerBase_meetsSkillConditions.call(this, skill);
};
//=============================================================================
// * Determine if Chain Skill is restricted
//=============================================================================
Game_BattlerBase.prototype.isChainSkillRestrict = function(skill) {
if (!this.isActor()) { return false;}
if (!$gameParty.inBattle()) { return false; }
if (!skill.meta.ChainOnly) { return false; }
return !this._activeChainEnabled;
};
//=============================================================================
// ** Game_Battler
//-----------------------------------------------------------------------------
// The superclass of Game_Actor and Game_Enemy. It contains methods for sprites
// and actions.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart;
_TDS_.ActiveChainSkills.Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd;
//=============================================================================
// * On Battle Start Processing
//=============================================================================
Game_Battler.prototype.onBattleStart = function() {
// Run Original Function
_TDS_.ActiveChainSkills.Game_Battler_onBattleStart.call(this);
// Set Active Chain Enabled Flag to false
this._activeChainEnabled = false;
};
//=============================================================================
// * On Battle End Processing
//=============================================================================
Game_Battler.prototype.onBattleEnd = function() {
// Run Original Function
_TDS_.ActiveChainSkills.Game_Battler_onBattleEnd.call(this);
// Set Active Chain Enabled Flag to false
this._activeChainEnabled = false;
};
//=============================================================================
// * Enable or Disable Active Chain
//=============================================================================
Game_Battler.prototype.enableActiveChain = function() { if (this.isActor()) { this._activeChainEnabled = true; } };
Game_Battler.prototype.disableActiveChain = function() { if (this.isActor()) { this._activeChainEnabled = false; } };
//=============================================================================
// * Add Active Skill Chain
//=============================================================================
Game_Battler.prototype.addActiveSkillChain = function(skillId) {
// Create Action
var action = new Game_Action(this);
// Set Action Active Chain Skill
action.setActiveChainSkill(skillId);
// Add Action to Actions list
this._actions.splice(1, 0, action);
};
//=============================================================================
// ** Game_Action
//-----------------------------------------------------------------------------
// The game object class for a battle action.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.Game_Action_isValid = Game_Action.prototype.isValid;
//=============================================================================
// * Set Active Chain Skill
//=============================================================================
Game_Action.prototype.setActiveChainSkill = function(skillId) {
// Set Skill
this.setSkill(skillId);
// Set Target
// this.subject().currentAction._targetIndex
this.setTarget(this.subject()._lastTargetIndex);
// Set Active Chain Skill
this._activeChainSkill = true;
};
//=============================================================================
// * Determine if action is valid
//=============================================================================
Game_Action.prototype.isValid = function() {
// Enable Active Chain
if (this._activeChainSkill) { this.subject().enableActiveChain(); }
// Get Original Result
var result = _TDS_.ActiveChainSkills.Game_Action_isValid.call(this);
// Disable Active Chain
if (this._activeChainSkill) { this.subject().disableActiveChain(); }
// Return Result
return result;
};
//=============================================================================
// ** Scene_Battle
//-----------------------------------------------------------------------------
// The scene class of the battle screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.Scene_Battle_CreateAllWindows = Scene_Battle.prototype.createAllWindows;
//=============================================================================
// * Create All Windows
//=============================================================================
Scene_Battle.prototype.createAllWindows = function() {
// Run Original Function
_TDS_.ActiveChainSkills.Scene_Battle_CreateAllWindows.call(this);
// Create Chain Skill Window
this.createChainSkillWindow();
};
//=============================================================================
// * Create Chain Skill Window
//=============================================================================
Scene_Battle.prototype.createChainSkillWindow = function() {
// Create Active Chain Skill Window
this._activeChainSkillWindow = new Window_ChainSkillList();
// Add Child
this.addChild(this._activeChainSkillWindow);
// Set Battle Manager Active Chain Skill Window
BattleManager.setActiveChainSkillWindow(this._activeChainSkillWindow);
};
//=============================================================================
// ** Window_BattleLog
//-----------------------------------------------------------------------------
// The window for displaying battle progress. No frame is displayed, but it is
// handled as a window for convenience.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ActiveChainSkills.Window_BattleLog_initialize = Window_BattleLog.prototype.initialize;
_TDS_.ActiveChainSkills.Window_BattleLog_startAction = Window_BattleLog.prototype.startAction;
_TDS_.ActiveChainSkills.Window_BattleLog_update = Window_BattleLog.prototype.update;
_TDS_.ActiveChainSkills.Window_BattleLog_updateWaitMode = Window_BattleLog.prototype.updateWaitMode;
_TDS_.ActiveChainSkills.Window_BattleLog_displayAction = Window_BattleLog.prototype.displayAction;
_TDS_.ActiveChainSkills.Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults;
//=============================================================================
// * Initialize Object
//=============================================================================
Window_BattleLog.prototype.initialize = function() {
// Run Original Function
_TDS_.ActiveChainSkills.Window_BattleLog_initialize.call(this);
// Set Active Chain Skill Input Couner to 0
this._activeChainSkillInputCounter = 0;
// Set Active Chain Skill to 0
this._activeChainSkill = 0;
};
//=============================================================================
// * Process Custom Code
//=============================================================================
Window_BattleLog.prototype.processCustomCode = function(code) { code(); };
//=============================================================================
// * Start Action
//=============================================================================
//Window_BattleLog.prototype.startAction = function(subject, action, targets) {
// Enable Active Chain
// this.push('processCustomCode', function() { subject.enableActiveChain();});
// Get Item
// var item = action.item();
// Show Chain List
// this.push('showChainSkillList', subject, item);
// Process Custom Code
// this.push('processCustomCode', _TDS_.ActiveChainSkills.Window_BattleLog_startAction.bind(this, subject, action, targets));
// Start Skill Chain Wait
// this.push('startChainSkillInputWait');
//};
//=============================================================================
// * Start Action
//=============================================================================
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
// Enable Active Chain
this.push('processCustomCode', function() { subject.enableActiveChain();});
// Get Item
var item = action.item();
// Show Chain List
this.push('showChainSkillList', subject, item);
// Process Custom Code
this.push('processCustomCode', _TDS_.ActiveChainSkills.Window_BattleLog_startAction.bind(this, subject, action, targets));
// Clear Text
this.push('clear');
// Start Skill Chain Wait
this.push('startChainSkillInputWait');
};
//=============================================================================
// * Display Action Results
//=============================================================================
Window_BattleLog.prototype.displayActionResults = function(subject, target) {
// Run Original Function
_TDS_.ActiveChainSkills.Window_BattleLog_displayActionResults.call(this, subject, target);
// If Subject is an actor
if (subject.isActor()) {
// Get Chain Window
var chainWindow = BattleManager._activeChainSkillWindow;
// If Chain Window is visible
if (chainWindow.visible) {
// Set Wait mode to chain skill input
this.push('setWaitMode', 'chainSkillInput');
// Hide Chain List
this.push('hideChainSkillList');
}
// Enable Active Chain
this.push('processCustomCode', function() { subject.disableActiveChain();});
}
};
//=============================================================================
// * Show Chain Skill List
//=============================================================================
Window_BattleLog.prototype.showChainSkillList = function(subject, skill) {
if (subject === undefined) { return; }
if (!subject.isActor()) { return; }
if (!DataManager.isSkill(skill)) { return; }
// Set Active Chain Skill to 0
// Get Chain Window
var chainWindow = BattleManager._activeChainSkillWindow;
this._activeChainSkill = 0;
// Setup Chain Window
chainWindow.setup(subject, skill);
// If Chain Window is more than 0
if (chainWindow._chainSkills.length > 0) { chainWindow.show(); }
};
//=============================================================================
// * Show Chain Skill List
//=============================================================================
Window_BattleLog.prototype.hideChainSkillList = function() {
// Set Active Chain Skill to 0
this._activeChainSkill = 0;
// Hide Active Chain Skill Window
BattleManager._activeChainSkillWindow.hide();
};
//=============================================================================
// * Start Chain Skill Input Wait
//=============================================================================
Window_BattleLog.prototype.startChainSkillInputWait = function() {
// Set Active chain Skill Input Counter
this._activeChainSkillInputCounter = _TDS_.ActiveChainSkills.params.minimunInputTime ;
};
//=============================================================================
// * Frame Update
//=============================================================================
Window_BattleLog.prototype.update = function() {
// Get Chain Window
var chainWindow = BattleManager._activeChainSkillWindow;
// If Chain Window Exists and its visible
if (chainWindow && chainWindow.visible) { this.updateChainkSkillInput(); }
// Call Original Function
_TDS_.ActiveChainSkills.Window_BattleLog_update.call(this);
};
//=============================================================================
// * Update Chain Skill Input
//=============================================================================
Window_BattleLog.prototype.updateChainkSkillInput = function() {
// Get Chain Window
var chainWindow = BattleManager._activeChainSkillWindow;
// Get Chain Window Skill
var chainSkills = chainWindow._chainSkills;
// If Active Chain Skill is 0
if (this._activeChainSkill === 0) {
// Go Through Chain Skills
for (var i = 0; i < chainSkills.length; i++) {
// Get Input
var input = chainSkills[i][0];
// Get Skill
var skill = chainSkills[i][1];
// If Input is triggered
if (Input.isTriggered(input)) {
// Get Subject
var subject = chainWindow._battler;
if (!subject.canUse(skill)) { continue; }
if (!subject.isLearnedSkill(skill.id)) { continue; }
// Play Sound Effect
AudioManager.playSe(_TDS_.ActiveChainSkills.params.activeSkillSound);
// Set Chain Window Input
chainWindow.chainInput = input;
// Set Active Chain Skill Input Count to 12
this._activeChainSkillInputCounter = 12;
// Set Active Chain Skill Id
this._activeChainSkill = skill.id;
// Add Active Skill Chain to subject
subject.addActiveSkillChain(skill.id);
// Refresh Chain Window
// Break Loop
break;
}
}
}
// If Active Chain Skill Input counter is more than 0
if (this._activeChainSkillInputCounter > 0) {
// Decrease Active Chain Skill Input counter
this._activeChainSkillInputCounter--;
// Return True
return true;
}
};
//=============================================================================
// * Update Wait Mode
//=============================================================================
Window_BattleLog.prototype.updateWaitMode = function() {
// If Wait mode is for chain skill input
if (this._waitMode === 'chainSkillInput') {
// If Active Chain Skill Input counter is more than 0
if (this._activeChainSkillInputCounter > 0) { return true; }
}
// Return Original Function
return _TDS_.ActiveChainSkills.Window_BattleLog_updateWaitMode.call(this);
};
//=============================================================================
// ** Window_ChainSkillList
//-----------------------------------------------------------------------------
// The window for displaying battle progress. No frame is displayed, but it is
// handled as a window for convenience.
//=============================================================================
function Window_ChainSkillList() { this.initialize.apply(this, arguments);}
Window_ChainSkillList.prototype = Object.create(Window_Base.prototype);
Window_ChainSkillList.prototype.constructor = Window_ChainSkillList;
//=============================================================================
// * Initialize Object
//=============================================================================
Window_ChainSkillList.prototype.initialize = function() {
// Get Width
var dw = Math.max(Math.round(Graphics.boxWidth / 2), 450);
// Super Call
Window_Base.prototype.initialize.call(this, -this.standardPadding(), 0, dw, this.fittingHeight(6));
// Set Opacity to 0;
this.opacity = 0;
// Hide
this.hide();
};
//=============================================================================
// * Setup
//=============================================================================
Window_ChainSkillList.prototype.setup = function(battler, skill) {
// Set Battler
this._battler = battler;
// Set Skill
this._skill = skill;
// Initialize Chain Skills Array
this._chainSkills = [];
// If Skill has a chain skill list
if (skill.meta.chainSkillList) {
// Get Inputs
var inputs = Object.keys(skill.meta.chainSkillList);
// Go Through Inputs
for (var i = 0; i < inputs.length; i++) {
// Get Input
var input = inputs[i];
// Get Chain Skill
var chainSkill = skill.meta.chainSkillList[input];
// If Battler does not have skill
if (!battler.isLearnedSkill(chainSkill)) { continue; }
// Add Skill to Chain Skills array
this._chainSkills.push([input, $dataSkills[chainSkill]]);
}
}
// Set Y Coordinates
this.y = Graphics.boxHeight - this.fittingHeight(4);
this.y -= this.fittingHeight(this._chainSkills.length + 1);
// Set Enabled Flag to true;
this._enabled = true;
// Refresh Contents
this.refresh();
};
//=============================================================================
// * Show Window
//=============================================================================
Window_ChainSkillList.prototype.show = function() {
// Activate Window
this.activate();
// Super Call
Window_Base.prototype.show.call(this);
};
//=============================================================================
// * Chain Input
//=============================================================================
Object.defineProperty(Window_ChainSkillList.prototype, 'chainInput', {
get: function() { return this._chainInput; },
set: function(value) {
// Set Chain Input
this._chainInput = value;
// Set Enabled Flag
this._enabled = false;
// Refresh if value is not null
if (value !== null) { this.refresh(); }
},
configurable: true
});
//=============================================================================
// * Refresh
//=============================================================================
Window_ChainSkillList.prototype.refresh = function() {
// Set Chain Input to null if enabled
if (this._enabled) { this._chainInput = null; }
// Clear Contents
this.contents.clear();
// Draw Background Color
this.drawBackgroundColor();
// Draw Chain Skill Title
this.drawChainSkillTitle();
// If Skill Exists
if (this._skill) {
// Draw Chain Skills
this.drawChainSkills();
}
};
//=============================================================================
// * Draw Background Color
//=============================================================================
Window_ChainSkillList.prototype.drawBackgroundColor = function() {
// Get Height
var dh = this.lineHeight() * (this._chainSkills.length + 1);
this.contents.gradientFillRect(0, 0, this.contents.width, dh, 'rgba(0, 0, 0, 192)', 'rgba(0, 0, 0, 0)');
this.contents.paintOpacity = 78;
this.contents.fillRect(0, this.lineHeight() - 4, this.contents.width, 2, this.normalColor());
this.contents.paintOpacity = 255;
};
//=============================================================================
// * Draw Chain Skills
//=============================================================================
Window_ChainSkillList.prototype.drawChainSkillTitle = function() {
// Reset Font Settings
this.resetFontSettings();
this.contents.fontSize = _TDS_.ActiveChainSkills.params.titleFontSize;
this.contents.fontItalic = true;
// Draw Title
this.drawText(_TDS_.ActiveChainSkills.params.chainTitle, 12, 0, this.contents.width - 24);
// Reset Font Settings
this.resetFontSettings();
};
//=============================================================================
// * Draw Chain Skills
//=============================================================================
Window_ChainSkillList.prototype.drawChainSkills = function() {
// Set Starting X & Y
var sx = 24, sy = this.lineHeight();
// If Skill has a chain skill list
if (this._skill.meta.chainSkillList) {
// Get Inputs
var inputs = Object.keys(this._skill.meta.chainSkillList);
// Go Through Inputs
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
var skill = $dataSkills[this._skill.meta.chainSkillList[input]];
// If Skill has not been learned
if (!this._battler.isLearnedSkill(skill.id)) { continue; }
// Set Text
var text = '';
// Add Input Text Settings
text = text + this.inputTextSettings(input, skill);
// Add Format to Text
text = text + '\\i[%1]%2'.format(skill.iconIndex, skill.name);
// Draw Text
this.drawTextEx(text, sx, sy);
// Increase Starting Y
sy += this.lineHeight();
}
}
};
//=============================================================================
// * Input Text Settings
//=============================================================================
Window_ChainSkillList.prototype.inputTextSettings = function(input, skill) {
// Set Active Flag
var active = (input === this._chainInput);
// Initialize Text
var text = '';
// Get Input Data
var inputData = _TDS_.ActiveChainSkills.params.inputData;
// Get Input DAta
if (inputData[input]) {
// If Enabled and Battler can use skill
if (this._enabled && this._battler.canUse(skill)) {
// Set Text
text = inputData[input].on;
} else if (!this._enabled && active) {
// Set Text
text = inputData[input].act;
} else {
// Set Text
text = inputData[input].off;
}
}
// Return Text
return text;
};

View file

@ -0,0 +1,772 @@
//=============================================================================
// Aetherflow Plugins - Preload Everything
// Aetherflow_PreloadEverything.js
//=============================================================================
/*:
* @plugindesc v1.0.2 Preload All The Things. (IF YOU HAVE v1.6.1)
* @author Kaliya
*
* @param ReleaseMapChange
* @text Release On Map Change
* @type boolean
* @default true
* @desc Release non-system/global preloaded assets from memory on map change?
*
* @param PreloadSystem
* @text Preload System Resources
* @type boolean
* @default true
* @desc Preload all system based assets on start?
*
* @param ImageCacheSize
* @text Image Cache Size
* @desc Size of the image cache in bytes.
* @type text
* @default 10 * 1000 * 1000
*
* @param AudioCacheSize
* @text Audio Cache Size
* @desc Size of the audio cache in bytes.
* @type text
* @default 20 * 1000 * 1000
*
* @param PreloadGlobal
* @text Global Assets
* @type struct<PreloadContainer>
* @desc Preloaded assets that are kept in memory on game start.
*
* @param PreloadMaps
* @text Map Assets
* @desc A list of Preload Containers used for map assets.
* @type struct<PreloadMapContainer>[]
*
* @help
* ---------------------------------------------------------------------------------
* Introduction
* ---------------------------------------------------------------------------------
* This plugin is designed to allieviate your "preloading" problems. Tired of not
* having your sound play right away when you need it? Tired of some images not
* appearing? Well look no further because those days are a thing of the past. Not
* only does this plugin preload your thingys, but it also acts as a basic caching
* system to help with the problem of memory being overused (if done right). It is
* not a perfect solution, but it should help all games.
*
* NOTE: THIS PLUGIN REQUIRES RPG MAKER MV V1.6.1 IF YOU ARE NOT USING V1.6.1
* THIS PLUGIN WILL NOT WORK AND WILL ERROR OUT. YOU HAVE BEEN WARNED.
*
* ---------------------------------------------------------------------------------
* How-to
* ---------------------------------------------------------------------------------
* The system is fairly straightforward, it uses "containers" to preload and store
* resources. These containers come in two flavors:
*
* GLOBAL: This is a singular container, it is used to store Global, or game wide assets
* these assets are usually things you always want to be loaded. They are all loaded on
* game start.
*
* MAP: These containers are what you use to preload map resources. These containers
* are loaded when the map associated with them is entered. Depending on your plugin
* parameters they will also be released from the cache when you enter a new map.
*
* In order to use the containers you simply modify and add to them via plugin parameters.
*
* ---------------------------------------------------------------------------------
* Caching & How It Works
* ---------------------------------------------------------------------------------
*
* The caching system stores assets in memory until they are no longer needed and
* are manually purged via the available functions, or by being deleted by the system
* itself when a new resource is loaded and the cache is full.
*
* The cache size is determined by two plugin parameters:
*
* Image Cache Size: The size of the image cache in bytes.
*
* Audio Cache Size: The size of the audio cache in bytes.
*
* These two plugin parameters are evaluated and thus you can use math to determine
* what the size rather than having to write out a large number. (e.g: 10 * 1000 * 1000 is a 10MB cache).
*
* You can use various functions in the cache classes to "Reserve" a resource. These
* "reserved" resources will not be automatically purged, so be careful!
*
* When a resource is added to the cache, the cache is sorted by the time the resources were all
* last touched and then if a resource is not reserved it is purged and will need to be reacquired
* again when next used.
*
* ---------------------------------------------------------------------------------
* Containers
* ---------------------------------------------------------------------------------
* For those users who are more hands on, the caching system has a type of object
* known as a "Container". Think of this as a group of objects, that can all be cached
* together and then can all be purged together at the same time, for easy cleanup and
* management. These are not the same as containers you setup in the plugin parameters.
* These containers are only accessed and used via code.
*
* Various function exists to help with the ease and usage of containers. They are
* all well documented throughout the plugin but a brief overview of them is as follows:
*
* ImageManager/AudioManager.addContainer("containerName"): Adds a container to the
* specified resource cache for that type.
*
* ImageManager/AudioManager.addContainerItem("containerName", "itemKey"): Adds an item
* to the container. NOTE: It only adds a key to look up the item in the cache for purging,
* it does not preload or load an item for you, you will need to do that prior to adding it
* to a container.
*
* ImageManager/AudioManager.releaseContainer("containerName"): Releases all objects
* within the specified container from the cache.
*
* ImageManager/AudioManager.releaseContainerItem("containerName", "itemKey"): Releases
* the specified item from the specified container if it exists, freeing it from the
* cache.
*
* ---------------------------------------------------------------------------------
* Credits
* ---------------------------------------------------------------------------------
* This plugin is developed and maintained by Liquidize/Kaliya.
* Some code was ninja'ed with permission from Pivoo (http://pivoo.me)
*
* ---------------------------------------------------------------------------------
* Changelog
* ---------------------------------------------------------------------------------
*
* 1.0.2:
* - Fixed a bug wherein due to slight changes in handling paths, Map based container for images were not being loaded.
*
* 1.0.1:
* - Fixed a bug wherein due to a slight change before release, the path for audio files
* would be incorrect.
*
* 1.0.0:
* - Released!
*
*/
/*~struct~PreloadContainer:
@param Images
@type file[]
@dir images/
@desc A list of images you want to preload for this container.
@param Audio
@type file[]
@dir audio/
@desc A list of audio files you want to preload for this container.
*/
/*~struct~PreloadMapContainer:
@param MapId
@text Map ID
@type number
@desc The id the of map for this container.
@min 0
@max 999
@default 0
@param Images
@type file[]
@dir images/
@desc A list of images you want to preload for this container.
@param Audio
@type file[]
@dir audio/
@desc A list of audio files you want to preload for this container.
*/
//=============================================================================
// PluginManager
//
// NOTE: The parameter parsing functions were originally written by Pivoo (http://pivoo.me)
// he has kindly given me permission to include and modify them but all credit should
// go to him.
//=============================================================================
PluginManager.parseObject = function (obj) {
var output = new Object();
Object.keys(obj).forEach(function (key) {
var param = obj[key];
output[key] = this.parse(param, key);
}, this);
return output;
};
PluginManager.parseArray = function (arr, key) {
return arr.map(function (param, index) {
return this.parse(param, key + '[' + index + ']');
}, this);
};
PluginManager.parse = function (param, key) {
if (!isNaN(param) && param.contains('.')) {
return parseFloat(param);
} else {
try {
param = JSON.parse(param);
switch (param.constructor.name) {
case 'Object': return this.parseObject(param);
case 'Array': return this.parseArray(param, key);
default: return param;
}
} catch (err) {
return param;
}
}
};
//=============================================================================
// Configuration
//=============================================================================
var Aetherflow = Aetherflow || {};
Aetherflow.Preload = Aetherflow.Preload || {};
Aetherflow.Parameters = PluginManager.parameters('Aetherflow_PreloadEverything');
Aetherflow.Param = Aetherflow.Param || {};
Aetherflow.Param["ReleaseMapChange"] = Boolean(Aetherflow.Parameters["ReleaseMapChange"]);
Aetherflow.Param["PreloadSystem"] = eval(Aetherflow.Parameters["PreloadSystem"]);
Aetherflow.Param["PreloadConnections"] = Boolean(Aetherflow.Parameters["PreloadConnections"]);
Aetherflow.Param["GlobalContainer"] = Aetherflow.Parameters["PreloadGlobal"].length > 0 ? JSON.parse(Aetherflow.Parameters["PreloadGlobal"]) : {};
Aetherflow.Param["MapContainers"] = Aetherflow.Parameters["PreloadMaps"].length > 0 ? JSON.parse(Aetherflow.Parameters["PreloadMaps"]) : {};
Aetherflow.Param["ImageCacheSize"] = Number(eval(Aetherflow.Parameters["ImageCacheSize"])) || 10 * 1000 * 1000;
Aetherflow.Param["AudioCacheSize"] = Number(eval(Aetherflow.Parameters["AudioCacheSize"])) || 20 * 1000 * 1000;
// Parse the actual data into the Preload Object for referencing easier.
Aetherflow.Preload.GlobalContainer = PluginManager.parseObject(Aetherflow.Param.GlobalContainer);
Aetherflow.Preload.MapContainers = Object.values(PluginManager.parseObject(Aetherflow.Param.MapContainers));
//=============================================================================
// End Configuration
//=============================================================================
//=============================================================================
// Game_System
//=============================================================================
Game_System.prototype.releaseGlobalContainer = function () {
ImageManager.releaseGlobalContainer();
AudioManager.releaseGlobalContainer();
};
//=============================================================================
// WebAudio
//=============================================================================
WebAudio.prototype.bufferSize = function () {
return this._buffer ? this._buffer.length : null;
};
//=============================================================================
// ImageCache
//=============================================================================
Aetherflow.Preload.ImageCache_initialize = ImageCache.prototype.initialize;
ImageCache.prototype.initialize = function () {
this._containers = {};
Aetherflow.Preload.ImageCache_initialize.call(this);
};
ImageCache.prototype.releaseItem = function (key) {
if (this._items[key]) {
delete this._items[key];
return true;
}
return false;
};
ImageCache.prototype.addContainer = function (container) {
this._containers = this._containers || {};
if (!this._containers[container]) {
this._containers[container] = [];
}
};
ImageCache.prototype.addContainerItem = function (container, itemKey) {
if (this._containers[container]) {
this._containers[container].push(itemKey);
}
};
ImageCache.prototype.releaseContainer = function (container) {
if (!this._containers) this._containers = {};
if (!this._containers[container]) return false;
for (let key of this._containers[container]) {
this.releaseItem(key);
}
delete this._containers[container];
return true;
};
ImageCache.prototype.releaseContainerItem = function (container, itemKey) {
if (!this._container) this._containers = {};
if (!this._containers[container]) return false;
let index = this._containers[container].indexOf(itemKey);
if (index >= 0) {
this._containers[container].splice(index, 1);
return this.releaseItem(itemKey);
}
return false;
};
//=============================================================================
// ImageManager
//=============================================================================
ImageManager.addContainer = function (container) {
return this._imageCache.addContainer(container);
};
ImageManager.addContainerItem = function (container, key) {
return this._imageCache.addContainerItem(container, key);
};
ImageManager.releaseItem = function (img, hue) {
let key = this._generateCacheKey(img, hue);
return this._imageCache.releaseItem(key);
};
ImageManager.releaseContainer = function (container) {
return this._imageCache.releaseContainer(container);
};
ImageManager.releaseContainerItem = function (container, img, hue) {
let key = this._generateCacheKey(img, hue);
return this._imageCache.releaseContainerItem(container, key);
};
ImageManager.releaseGlobalContainer = function () {
return this.releaseContainer("global");
};
//=============================================================================
// AudioCache
//=============================================================================
function AudioCache() {
this.initialize.apply(this, arguments);
}
AudioCache.maxSize = Aetherflow.Param["AudioCacheSize"];
AudioCache.prototype.initialize = function () {
this._items = {};
this._containers = {};
};
AudioCache.prototype.add = function (key, value) {
this._items[key] = {
buffer: value,
touch: Date.now(),
key: key
};
this.truncateCache();
};
AudioCache.prototype.get = function (key) {
if (this._items[key]) {
let item = this._items[key];
item.touch = Date.now();
return item.buffer;
}
return null;
};
AudioCache.prototype.releaseItem = function (key) {
if (this._items[key]) {
delete this._items[key];
return true;
}
return false;
};
AudioCache.prototype.addContainer = function (container) {
this._containers = this._containers || {};
if (!this._containers[container]) {
this._containers[container] = [];
}
};
AudioCache.prototype.addContainerItem = function (container, itemKey) {
if (this._containers[container]) {
this._containers[container].push(itemKey);
}
};
AudioCache.prototype.releaseContainer = function (container) {
if (!this._containers) this._containers = {};
if (!this._container[container]) return false;
for (let key of this._containers[container]) {
this.releaseItem(key);
}
delete this._containers[container];
return true;
};
AudioCache.prototype.releaseContainerItem = function (container, itemKey) {
if (!this._containers) this._containers = {};
if (!this._containers[container]) return false;
let index = this._containers[container].indexOf(itemKey);
if (index >= 0) {
this._containers[container].splice(index, 1);
return this.releaseItem(itemKey);
}
return false;
};
AudioCache.prototype.reserve = function (key, value, reservationId) {
if (!this._items[key]) {
this._items[key] = {
buffer: value,
touch: Date.now(),
key: key
};
}
this._items[key].reservationId = reservationId;
};
AudioCache.prototype.releaseReservation = function (reservationId) {
let items = this._items;
let release = false;
Object.keys(items).map(function (key) {
return items[key];
}).forEach(function (item) {
if (item.reservationId === reservationId)
release = true;
delete item.reservationId;
});
return release;
};
AudioCache.prototype.truncateCache = function () {
let items = this._items;
let sizeLeft = AudioCache.maxSize;
Object.keys(items).map(function (key) {
return items[key];
}).sort(function (a, b) {
return b.touch - a.touch;
}).forEach(function (item) {
if (sizeLeft > 0 || this.mustBeHeld(item)) {
sizeLeft -= item.buffer.bufferSize() ? item.buffer.bufferSize() : 0; // If buffer isn't available than it isn't loaded.
} else {
delete items[item.key];
}
}.bind(this));
};
AudioCache.prototype.mustBeHeld = function (item) {
if (item.reservationId) return true;
if (!item.buffer.isReady()) return true;
return false;
};
AudioCache.prototype.isReady = function () {
let items = this._items;
return !Object.keys(items).some(function (key) {
return !items[key].buffer.isReady();
});
};
//=============================================================================
// AudioManager
//=============================================================================
AudioManager._cache = new AudioCache();
AudioManager._systemReservationId = Utils.generateRuntimeId();
AudioManager._defaultReservationId = "default";
window._aufs = require("fs");
AudioManager._generateCacheKey = function (path) {
return path;
};
AudioManager.clear = function () {
this._cache = new AudioCache();
};
AudioManager.isReady = function () {
return this._cache.isReady();
};
AudioManager.setDefaultReservationid = function (reservationId) {
this._defaultReservationId = reservationId;
};
AudioManager.addContainer = function (container) {
return this._cache.addContainer(container);
};
AudioManager.addContainerItem = function (container, itemKey) {
return this._cache.addContainerItem(container, itemKey);
};
AudioManager.loadBgm = function (filename) {
let path = this._path + "bgm/" + encodeURIComponent(filename) + this.audioFileExt();
return this.loadAudio(path);
};
AudioManager.loadBgs = function (filename) {
let path = this._path + "bgs/" + encodeURIComponent(filename) + this.audioFileExt();
return this.loadAudio(path);
};
AudioManager.loadSe = function (filename) {
let path = this._path + "se/" + encodeURIComponent(filename) + this.audioFileExt();
return this.loadAudio(path);
};
AudioManager.loadMe = function (filename) {
let path = this._path + "me/" + encodeURIComponent(filename) + this.audioFileExt();
return this.loadAudio(path);
};
AudioManager.loadAudio = function (path) {
path = _aufs.cachedAlternativeName(path);
let key = this._generateCacheKey(path);
let buffer = this._cache.get(key);
if (!buffer) {
buffer = new WebAudio(path);
this._cache.add(key, buffer);
}
return buffer;
};
AudioManager.reserveBgm = function (filename, reservationId) {
return this.reserveAudio("bgm/", filename, reservationId);
};
AudioManager.reserveBgs = function (filename, reservationId) {
return this.reserveAudio("bgs/", filename, reservationId);
};
AudioManager.reserveSe = function (filename, reservationId) {
return this.reserveAudio("se/", filename, reservationId);
};
AudioManager.reserveMe = function (filename, reservationId) {
return this.reserveAudio("me/", filename, reservationId);
};
AudioManager.reserveAudio = function (folder, filename, reservationId) {
if (filename) {
let path = _aufs.cachedAlternativeName(this._path + folder + encodeURIComponent(filename) + this.audioFileExt());
let buffer = new WebAudio(path);
this._cache.reserve(this._generateCacheKey(path), buffer, reservationId || this._defaultReservationId);
return buffer;
} else {
return null;
}
};
AudioManager.releaseItem = function (key) {
return this._cache.releaseItem(key);
};
AudioManager.releaseContainer = function (container) {
return this._cache.releaseContainer(container);
};
AudioManager.releaseContainerItem = function (container, key) {
return this._cache.releaseContainerItem(container, key);
};
AudioManager.releaseReservation = function (reservationId) {
return this._cache.releaseReservation(reservationId);
};
AudioManager.releaseGlobalContainer = function () {
return this.releaseContainer("global");
};
AudioManager.playBgm = function (bgm, pos) {
if (this.isCurrentBgm(bgm)) {
this.updateBgmParameters(bgm);
} else {
this.stopBgm();
if (bgm.name) {
if (Decrypter.hasEncryptedAudio && this.shouldUseHtml5Audio()) {
this.playEncryptedBgm(bgm, pos);
}
else {
this._bgmBuffer = this.loadBgm(bgm.name);
this.updateBgmParameters(bgm);
if (!this._meBuffer) {
this._bgmBuffer.play(true, pos || 0);
}
}
}
}
this.updateCurrentBgm(bgm, pos);
};
AudioManager.playBgs = function (bgs, pos) {
if (this.isCurrentBgs(bgs)) {
this.updateBgsParameters(bgs);
} else {
this.stopBgs();
if (bgs.name) {
this._bgsBuffer = this.loadBgs(bgs.name);
this.updateBgsParameters(bgs);
this._bgsBuffer.play(true, pos || 0);
}
}
this.updateCurrentBgs(bgs, pos);
};
AudioManager.playSe = function (se) {
if (se.name) {
this._seBuffers = this._seBuffers.filter(function (audio) {
return audio.isPlaying();
});
let buffer = this.loadSe(se.name);
this.updateSeParameters(buffer, se);
buffer.play(false);
this._seBuffers.push(buffer);
}
};
AudioManager.playMe = function (me) {
this.stopMe();
if (me.name) {
if (this._bgmBuffer && this._currentBgm) {
this._currentBgm.pos = this._bgmBuffer.seek();
this._bgmBuffer.stop();
}
this._meBuffer = this.loadMe(me.name);
this.updateMeParameters(me);
this._meBuffer.play(false);
this._meBuffer.addStopListener(this.stopMe.bind(this));
}
};
//=============================================================================
// DataManager
//=============================================================================
Aetherflow.Preload.DataManager_onLoad = DataManager.onLoad;
DataManager.onLoad = function (object) {
Aetherflow.Preload.DataManager_onLoad.call(this, object);
if (object === $dataSystem) {
Scene_Boot.loadSystemAudio();
Scene_Boot.loadGlobalContainer();
}
};
//=============================================================================
// Scene_Base
//=============================================================================
Aetherflow.Preload.Scene_Base_isReady = Scene_Base.prototype.isReady;
Scene_Base.prototype.isReady = function () {
return Aetherflow.Preload.Scene_Base_isReady.call(this) && AudioManager.isReady();
};
//=============================================================================
// Scene_Boot
//=============================================================================
Scene_Boot.loadSystemAudio = function () {
if (Aetherflow.Param.PreloadSystem === true) {
AudioManager.reserveBgm($dataSystem.airship.bgm.name, AudioManager._systemReservationId);
AudioManager.reserveBgm($dataSystem.battleBgm.name, AudioManager._systemReservationId);
AudioManager.reserveBgm($dataSystem.boat.bgm.name, AudioManager._systemReservationId);
AudioManager.reserveBgm($dataSystem.ship.bgm.name, AudioManager._systemReservationId);
AudioManager.reserveBgm($dataSystem.titleBgm.name, AudioManager._systemReservationId);
AudioManager.reserveMe($dataSystem.gameoverMe.name, AudioManager._systemReservationId);
AudioManager.reserveMe($dataSystem.defeatMe.name, AudioManager._systemReservationId);
AudioManager.reserveMe($dataSystem.victoryMe.name, AudioManager._systemReservationId);
$dataSystem.sounds.forEach(function (sound) {
AudioManager.reserveSe(sound.name, AudioManager._systemReservationId);
});
}
};
Scene_Boot.loadGlobalContainer = function () {
if (Aetherflow.Preload.GlobalContainer) {
ImageManager.addContainer("global");
AudioManager.addContainer("global");
let images = Aetherflow.Preload.GlobalContainer.Images;
if (images) {
for (let image of images) {
let folder = image.split('/')[0] + "/";
let file = image.split('/')[1];
let path = "img/" + folder;
ImageManager.reserveBitmap(path, file, 0, true);
ImageManager.addContainerItem("global", ImageManager._generateCacheKey(path, 0));
}
}
let sounds = Aetherflow.Preload.GlobalContainer.Audio;
if (sounds) {
for (let sound of sounds) {
let folder = sound.split('/')[0] + "/";
let file = sound.split('/')[1];
let path = require("fs").cachedAlternativeName("audio/" + folder + encodeURIComponent(file) + AudioManager.audioFileExt());
AudioManager.reserveAudio(folder, file);
AudioManager.addContainerItem("global", AudioManager._generateCacheKey(path));
}
}
}
};
//=============================================================================
// Scene_Map
//=============================================================================
Scene_Map.prototype.releaseAssets = function () {
let container = Aetherflow.Preload.MapContainers.find(function (element) {
return element.MapId === $gameMap.mapId();
});
if (container) {
if (container.Images && container.Images.length > 0) {
let images = container.Images;
for (let image of images) {
let folder = image.split('/')[0];
let file = image.split('/')[1];
let path = "img/" + folder + "/" + encodeURIComponent(file) + ".png";
ImageManager.releaseItem(path, 0);
}
}
if (container.Audio && container.Audio.length > 0) {
let sounds = container.Audio;
for (let sound of sounds) {
let folder = sound.split('/')[0];
let file = sound.split('/')[1];
AudioManager.releaseItem(require("fs").cachedAlternativeName("audio/" + folder + "/" + encodeURIComponent(file) + AudioManager.audioFileExt()));
}
}
}
};
Scene_Map.prototype.preloadAssets = function () {
let container = Aetherflow.Preload.MapContainers.find(function (element) {
return element.MapId === $gameMap.mapId();
});
if (container) {
let images = container.Images;
if (images) {
for (let image of images) {
let folder = image.split('/')[0] + "/";
let file = image.split('/')[1];
let path = "img/" + folder + encodeURIComponent(file) + ".png";
ImageManager.reserveNormalBitmap(path, 0, ImageManager._defaultReservationId);
}
}
let sounds = container.Audio;
if (sounds) {
for (let sound of sounds) {
let folder = sound.split('/')[0] + "/";
let file = sound.split('/')[1];
AudioManager.reserveAudio(folder, file, AudioManager._defaultReservationId);
}
}
}
};
Aetherflow.Preload.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function () {
this.releaseAssets();
Aetherflow.Preload.Scene_Map_onMapLoaded.call(this);
this.preloadAssets();
};

View file

@ -0,0 +1,35 @@
//=============================================================================
// TDS Anti Fail Actions
//=============================================================================
/*:
* @plugindesc Prevents failure messages from appearing in certain actions.
*
* @author TDS
*
* @help
*
* Action Note Tags:
*
* <AntiFail>
*
*/
(function() {
//==============================================================================================
// ** Game_Action
//==============================================================================================
// Alias Listing
var tds_AntiFailActions_Game_Action_applyItemUserEffect = Game_Action.prototype.applyItemUserEffect;
//==============================================================================================
// * Apply Item User Effect
//==============================================================================================
Game_Action.prototype.applyItemUserEffect = function(target) {
// Run Original Method
tds_AntiFailActions_Game_Action_applyItemUserEffect.call(this, target);
// If Anti Fail make success
if (this.item().meta.AntiFail) { this.makeSuccess(target) }
};
})();

View file

@ -0,0 +1,250 @@
//=============================================================================
// Archeia Core Changes
// Version: 1.0
//=============================================================================
/*:
* @plugindesc <Archeia_CoreChanges>
* This plugin modifies the core script and adds new things.
*
* @author AEL
*
* @help
*
* Nothing needs to be done.
*
*/
//=============================================================================
var Imported = Imported || {};
Imported.Archeia_CoreChanges = true;
//=============================================================================
// ** Parameter Check
//=============================================================================
var parameters = $plugins.filter(function(p) {
return p.description.contains('<Archeia_CoreChanges>') })[0].parameters;
//=============================================================================
// ** Set Parameters
//=============================================================================
var AEL = AEL || {};
AEL.Archeia_CoreChanges = AEL.Archeia_CoreChanges || {};
//-----------------------------------------------------------------------------
// * Fix Pixi FPS
//-----------------------------------------------------------------------------
/*(function(){
const oldFPSMeter = FPSMeter;
FPSMeter = function(){
oldFPSMeter.apply(this);
const FPSMeter_pause = this.pause;
this.pause = function(){
FPSMeter_pause.apply(this);
//sadly, we can't get frameId because of the fpsmeter.js is minified
//so, restart ticker in all case.
PIXI.ticker.shared._requestId = null;
PIXI.ticker.shared._requestIfNeeded();
}
}
})();*/
//-----------------------------------------------------------------------------
// * Pixi Texture Fix
//-----------------------------------------------------------------------------
PIXI.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 {
// }
// };

View file

@ -0,0 +1,250 @@
/*=============================================================================
* Archeia - Message Codes
* By Liquidize - htp://anima.mintkit.lol
* Archeia_MessageCodes.js
* Version: 1.02
*
* This plugin was created by Liquidize for use by Archeia and their team(s),
* I do not request credit in any form, You are licensed to use this plugin in
* anyway you see fit, for any number of projects,games,websites,etc,etc.
*
*
*=============================================================================*/
/*:
* @plugindesc Plugin Description <Archeia_MessageCodes>
* @author Liquidize
*
* @param Variable Set Code
* @desc The escape code used to set a variable.
* @default Var
*
* @param Variable Add Code
* @desc The escape code used to do the addition operation on a variable.
* @default VarA
*
* @param Variable Sub Code
* @desc The escape code used to do the subtraction operation on a variable.
* @default VarS
*
* @param Variable Mul Code
* @desc The escape code used to do the multiplication operation on a variable.
* @default VarX
*
* @param Variable Div Code
* @desc The escape code used to do the division operation on a variable.
* @default VarD
*
* @param Variable Mod Code
* @desc The escape code used do modulo on a variable.
* @default VarM
*
* @param Common Event Code
* @desc The escape code used to call a common event.
* @default Com
*
*
* @help
* This plugin provides two additional escape codes for use in messages. The
* first being an escape code to set the value of a variable, the second being
* an escape code to call a common event.
*
* ---------------------------------------------------------------------------
*
* To use the escape code to set a variable follow the below format:
*
* \ESCAPECODEHERE[VARIABLEID,VALUE]
*
* E.G: \V[10,10]
*
* The above example will set the variable with ID 10, to be the value of 10.
* The V is used as the escape code, as thats what the default value is. You can
* change this value by editing the Variable Code parameter.
*
*
*
* ---------------------------------------------------------------------------
*
* To use the escape code to call a common event, use the following:
*
* \ESCAPECODEHERE[COMMONEVENTID]
*
* E.G: \C[1]
*
* The above example will call the common event with ID of 1. The escape code
* used is C because that is the value of the default escape code, you can
* change it in the parameters.
*
* ============================================================================
* Change Log
* ============================================================================
*
* Version 1.02:
* - Refactored Code
* - Added the ability to call events while in battle.
* - Added the other operations when setting variables (albeit buggy).
*
* Version 1.01a:
* - Another potential fix for things.
*
* Version 1.01:
* - Fixed an issue causing incompatibility with YEP_MessageCore.
* - Potential fix for instant common event execution.
*
* Version 1.0:
* - Finished Script!
*
*=============================================================================*/
var Imported = Imported || {};
var Archeia = Archeia || {};
Archeia.MessageCodes = Archeia.MessageCodes || {};
Archeia.Utils = Archeia.Utils || {};
(function ($) {
"use strict";
var parameters = $plugins.filter(function (plugin) {
return plugin.description.contains('<Archeia_MessageCodes>');
});
if (parameters.length === 0) {
throw new Error("Couldn't find the parameters of Archeia_MessageCodes.");
}
$.Parameters = parameters[0].parameters;
$.Param = {};
$.Param.variableSetCode = String($.Parameters['Variable Set Code']);
$.Param.variableAddCode = String($.Parameters['Variable Add Code']);
$.Param.variableSubCode = String($.Parameters['Variable Sub Code']);
$.Param.variableMulCode = String($.Parameters['Variable Mul Code']);
$.Param.variableDivCode = String($.Parameters['Variable Div Code']);
$.Param.variableModCode = String($.Parameters['Variable Mod Code']);
$.Param.commonEventCode = String($.Parameters['Common Event Code']);
//================================================================================
// Window_Base
//================================================================================
Window_Base.prototype.obtainEscapeParamsArray = function (textState) {
var arr = /^\[(\d+,\d+)]/.exec(textState.text.slice(textState.index));
if (arr) {
textState.index += arr[0].length;
return arr[1].split(',');
} else {
return '';
}
};
var Window_Message_processEscapeCharacter = Window_Message.prototype.processEscapeCharacter;
Window_Message.prototype.processEscapeCharacter = function (code, textState) {
if (code === $.Param.commonEventCode.toUpperCase()) {
if ($gameParty && $gameParty.inBattle()) {
$gameTroop.setupCommonEvent(parseInt(this.obtainEscapeParam(textState)));
} else {
$gameMap.setupCommonEvent(parseInt(this.obtainEscapeParam(textState)));
}
} else if (code === $.Param.variableSetCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),0);
} else if (code === $.Param.variableAddCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),1);
} else if (code === $.Param.variableSubCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),2);
} else if (code === $.Param.variableMulCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),3);
} else if (code === $.Param.variableDivCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),4);
} else if (code === $.Param.variableModCode.toUpperCase()) {
this.changeVariable(this.obtainEscapeParamsArray(textState),5);
} else {
Window_Message_processEscapeCharacter.call(this, code, textState);
}
};
Window_Message.prototype.changeVariable = function (data,operation) {
if (data) {
var varId = parseInt(data[0]);
try {
var oldVal = $gameVariables.value(varId);
var val = parseInt(data[1]);
switch (operation) {
case 0:
$gameVariables.setValue(varId,oldVal = val);
break;
case 1:
$gameVariables.setValue(varId,oldVal + val);
break;
case 2:
$gameVariables.setValue(varId,oldVal - val);
break;
case 3:
$gameVariables.setValue(varId,oldVal * val);
break;
case 4:
$gameVariables.setValue(varId,oldVal / val);
break;
case 5:
$gameVariables.setValue(varId,oldVal % val);
break;
}
} catch (e) {
$gameVariables.setValue(varId,0);
}
}
};
//================================================================================
// Game_Map
//================================================================================
Game_Map.prototype.setupCommonEvent = function (commonId) {
var commonEvent = $dataCommonEvents[commonId];
if (commonEvent) {
var eventId = this._interpreter.isOnCurrentMap() ? this._interpreter._eventId : 0;
this._interpreter.setupChild(commonEvent.list, eventId);
}
};
Game_Map.prototype.stopCurrentEvent = function () {
if (this.isEventRunning()) {
this._interpreter.terminate();
}
};
//================================================================================
// Game_Troop
//================================================================================
Game_Troop.prototype.setupCommonEvent = function(commonId) {
var commonEvent = $dataCommonEvents[commonId];
if (commonEvent) {
var eventId = this._interpreter.isOnCurrentMap() ? this._interpreter._eventId : 0;
this._interpreter.setupChild(commonEvent.list, eventId);
}
};
//================================================================================
// UTILS
//================================================================================
// The below is a string formatting function that gives me/js/people/anyone/stuff
// the ability to use C#/C styled string formatting using {0},{1} for parameters.
Archeia.Utils.sformat = function () {
var theString = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var regEx = new RegExp("\\{" + (i - 1) + "\\}", "gm");
theString = theString.replace(regEx, arguments[i]);
}
return theString;
};
})(Archeia.MessageCodes);
ArcheiaMessageCodes = Archeia.MessageCodes;
Imported["Archeia_MessageCodes"] = 1.02;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,697 @@
//=============================================================================
// ★ Aries003_WeatherControl ★ 1.0.0
//=============================================================================
/*:
* @plugindesc Fine-tune in-game weather with various customizable features.
* @author Aries
*
* @help
* Aries003_WeatherControl 1.0.0
* ----------------------------------------------------------------------------
* The Weather Control plugin allows you to control the existing
* weather effects with much more fine-grained authority,
* and adds 3 new weather effects that does not come with RPG Maker MV.
*
* Control the look and feel of in-game weather by adjusting speed, angle,
* size, and assign an image for the 3 built-in weather effects.
*
* Thunder strikes can occur periodically, flashing the screen and playing
* a thunder sound effect. You can adjust the period and
* randomness via parameters.
*
* Plugin commands are also supplied that allow you to change images in-game.
* This change is not saved between files.
* ----------------------------------------------------------------------------
* Listed below are plugin and script commands to adjust weather in-game.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Plugin: AriesToggleStormThunder [Flag]
* Script: Aries.P003_WCT.toggleStormThunder [Flag]
*
* Enables or disables thunderflashes during a Storm.
* [Flag] - 'true' or 'false' without quotation marks.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Plugin: AriesWeather [Weather] [Power] [Duration]
* Script: $gameScreen.changeWeather([Weather], [Power], [Duration])
*
* Sets the current weather.
* [Weather] - 'none', 'rain', 'storm', 'snow', 'leaves', 'embers', 'shine'
* [Power] - A number between 1 to 9
* [Duration] - The duration in frames of how long the transition occurs for.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Plugin: AriesSetWeatherImage [Weather] [Filename]
* Script: Aries.P003_WCT.setWeatherImage([Weather], [Filename])
*
* Sets the current weather.
* [Weather] - 'none', 'rain', 'storm', 'snow', 'leaves', 'embers', 'shine'
* [Filename] - New image file for the weather effect.
* ----------------------------------------------------------------------------
* Changelog
* ----------------------------------------------------------------------------
*
* @param Rain
* @default
*
* @param Detailed Settings (Rain)
* @parent Rain
* @default
*
* @param Storm
* @default
*
* @param Detailed Settings (Storm)
* @parent Storm
* @default
*
* @param Snow
* @default
*
* @param Detailed Settings (Snow)
* @parent Snow
* @default
*
* @param Leaves
* @default
*
* @param Detailed Settings (Leaves)
* @parent Leaves
* @default
*
* @param Embers
* @default
*
* @param Detailed Settings (Embers)
* @parent Embers
* @default
*
* @param Shine
* @default
*
* @param Detailed Settings (Shine)
* @parent Shine
* @default
*
* @param Rain Image
* @parent Rain
* @desc Define a Picture file for raindrops. (Place image in the Pictures folder.)
* Valid: Any file name. Leave empty for default.
* @default
*
* @param Raindrop Count Minimum
* @parent Rain
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during Rain with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 12
*
* @param Raindrop Count Maximum
* @parent Rain
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during Rain with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 300
*
* @param Raindrop Lifetime
* @parent Detailed Settings (Rain)
* @type number
* @min 1
* @max 30
* @desc Controls how long a raindrop should last during Rain.
* Valid: A number between 1 to 30
* @default 5
*
* @param Raindrop Speed
* @parent Detailed Settings (Rain)
* @type number
* @min 1
* @max 100
* @desc Controls the speed of a raindrop during Rain.
* Valid: A number between 1 to 100
* @default 35
*
* @param Raindrop Angle Base
* @parent Detailed Settings (Rain)
* @type number
* @min -60
* @max 60
* @desc Controls the base angle at which raindrops fall during Rain.
* Valid: A number between -60 to 60
* @default 9
*
* @param Raindrop Angle Variation
* @parent Detailed Settings (Rain)
* @type number
* @min 0
* @max 180
* @desc Deviate raindrop angle up to X degrees during Rain. (4 is +-4°)
* Valid: A number between 0 to 180
* @default 4
*
* @param Raindrop Opacity Base
* @parent Detailed Settings (Rain)
* @type number
* @min 0
* @max 255
* @desc Controls the opacity of raindrops during Rain.
* Valid: A number between 0 to 255
* @default 180
*
* @param Raindrop Opacity Variation
* @parent Detailed Settings (Rain)
* @type number
* @min 0
* @max 128
* @desc Deviate raindrop opacity up to X value during Rain. (60 is +-60 opacity)
* Valid: A number between 0 to 128
* @default 60
*
* @param Raindrop Size Variation
* @parent Detailed Settings (Rain)
* @type number
* @min 0
* @max 50
* @desc Deviate raindrop sizes up to X% during Rain. (No effect when not using an image.)
* Valid: A number between 0 to 50
* @default 20
*
* @param Storm Raindrop Lifetime
* @parent Detailed Settings (Storm)
* @type number
* @min 1
* @max 30
* @desc Controls how long a raindrop should last during Storm.
* Valid: A number between 1 to 30
* @default 2
*
* @param Storm Raindrop Speed
* @parent Detailed Settings (Storm)
* @type number
* @min 1
* @max 100
* @desc Controls the speed of a raindrop during Storm.
* Valid: A number between 1 to 100
* @default 75
*
* @param Storm Raindrop Angle Base
* @parent Detailed Settings (Storm)
* @type number
* @min -60
* @max 60
* @desc Controls the base angle at which raindrops fall during Storm.
* Valid: A number between -60 to 60
* @default 18
*
* @param Storm Raindrop Angle Variation
* @parent Detailed Settings (Storm)
* @type number
* @min 0
* @max 180
* @desc Deviate raindrop angle up to X degrees during Storm. (12 is +-12°)
* Valid: A number between 0 to 180
* @default 12
*
* @param Storm Raindrop Opacity Base
* @parent Detailed Settings (Storm)
* @type number
* @min 0
* @max 255
* @desc Controls the opacity of raindrops during Storm.
* Valid: A number between 0 to 255
* @default 210
*
* @param Storm Raindrop Opacity Variation
* @parent Detailed Settings (Storm)
* @type number
* @min 0
* @max 128
* @desc Deviate raindrop opacity up to X value during Rain. (125 is +-125 opacity)
* Valid: A number between 0 to 128
* @default 125
*
* @param Storm Raindrop Size Variation
* @parent Detailed Settings (Storm)
* @type number
* @min 0
* @max 50
* @desc Deviate raindrop sizes up to X% during Storm. (No effect when not using an image.)
* Valid: A number between 0 to 50
* @default 33
*
* @param Storm Thunder
* @parent Storm
* @type boolean
* @on On
* @off Off
* @desc Flash the screen and play a sound effect occasionally during Storm.
* Valid: True/False
* @default true
*
* @param Storm Thunder in Battle
* @parent Storm Thunder
* @type boolean
* @on On
* @off Off
* @desc Allow thunderflashes to occur in battle.
* Valid: True/False
* @default false
*
* @param Thunder Sound
* @parent Storm Thunder
* @desc Sound effect to play when a thunderflash occurs.
* Valid: Any file name.
* @default Thunder9
*
* @param Thunder Sound Volume
* @parent Storm Thunder
* @type number
* @min 0
* @max 100
* @desc Volume of the sound effect played when a thunderflash occurs.
* Valid: A number between 0 to 100.
* @default 75
*
* @param Thunder Sound Pitch
* @parent Storm Thunder
* @type number
* @min 50
* @max 150
* @desc Pitch of the sound effect played when a thunderflash occurs.
* Valid: A number between 50 to 150.
* @default 100
*
* @param Thunder Sound Pitch Variation
* @parent Storm Thunder
* @type number
* @min 0
* @max 50
* @desc Deviate sound pitch up to X value when a thunderflash occurs.
* Valid: A number between 0 to 50.
* @default 15
*
* @param Thunder Flash Power
* @parent Storm Thunder
* @type number
* @min 0
* @max 255
* @desc Strength of the screen flash played when a thunderflash occurs.
* Valid: A number between 0-255.
* @default 180
*
* @param Thunder Flash Variation
* @parent Storm Thunder
* @type number
* @min 0
* @max 128
* @desc Deviate flash power up to X value when a thunderflash occurs.
* Valid: A number between 0-128.
* @default 50
*
* @param Thunder Wait Time
* @parent Storm Thunder
* @type number
* @desc Duration until the next thunderflash. (Adjusted based on Power)
* Valid: Any number
* @default 300
*
* @param Thunder Wait Time Variation
* @parent Storm Thunder
* @type number
* @desc Deviate wait time up to X value until the next thunderflash.
* Valid: Any number
* @default 45
*
* @param Storm Image
* @parent Storm
* @desc Define a Picture file for raindrops (Storm). (Place image in the Pictures folder.)
* Valid: Any file name. Leave empty for default.
* @default
*
* @param Storm Raindrop Count Minimum
* @parent Storm
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during a Storm with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 75
*
* @param Storm Raindrop Count Maximum
* @parent Storm
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during a Storm with the magnitude of 9.
* Valid: A number between 0 to 999
* @default 350
*
* @param Snow Image
* @parent Snow
* @desc Image used for snow.
* Valid: Any file name. Leave empty for default.
* @default
*
* @param Snow Count Minimum
* @parent Snow
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during Snow with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 12
*
* @param Snow Count Maximum
* @parent Snow
* @type number
* @min 0
* @max 999
* @desc Amount of raindrops to create during Snow with the magnitude of 9.
* Valid: A number between 0 to 999
* @default 320
*
* @param Snowflake Lifetime
* @parent Detailed Settings (Snow)
* @type number
* @min 1
* @max 80
* @desc Controls how long a snowflake should last during Snow.
* Valid: A number between 1 to 200
* @default 16
*
* @param Snowflake Speed Base
* @parent Detailed Settings (Snow)
* @type number
* @min 1
* @max 200
* @desc Controls the speed of a snowflake during Snow.
* Valid: A number between 1 to 200
* @default 25
*
* @param Snowflake Speed Variation
* @parent Detailed Settings (Snow)
* @type number
* @min 0
* @max 50
* @desc Deviate snowflake speed up to X value during Snow. (10 is +-10% speed)
* Valid: A number between 0 to 50
* @default 10
*
* @param Snowflake Opacity Base
* @parent Detailed Settings (Snow)
* @type number
* @min 0
* @max 255
* @desc Controls the opacity of snowflakes during Snow.
* Valid: A number between 0 to 255
* @default 220
*
* @param Snowflake Opacity Variation
* @parent Detailed Settings (Snow)
* @type number
* @min 0
* @max 255
* @desc Deviate snowflake opacity up to X value during Snow. (20 is +-20 opacity)
* Valid: A number between 0 to 255
* @default 20
*
* @param Snowflake Size Variation
* @parent Detailed Settings (Snow)
* @type number
* @min 0
* @max 50
* @desc Deviate snowflake sizes up to X% during Snow. (No effect when not using an image.)
* Valid: A number between 0 to 50
* @default 40
*
* @param Leaf Image
* @parent Leaves
* @desc Image used for leaves. * Leaf weather effects do not appear when left empty.
* Valid: Any file name.
* @default Leaf
*
* @param Leaf Count Minimum
* @parent Leaves
* @type number
* @min 0
* @max 999
* @desc Amount of leaves to create during Leaves with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 10
*
* @param Leaf Count Maximum
* @parent Leaves
* @type number
* @min 0
* @max 999
* @desc Amount of leaves to create during Leaves with the magnitude of 9.
* Valid: A number between 0 to 999
* @default 100
*
* @param Leaf Lifetime
* @parent Detailed Settings (Leaves)
* @type number
* @min 1
* @max 80
* @desc Controls how long a leaf should last during Leaves.
* Valid: A number between 1 to 200
* @default 80
*
* @param Leaf Speed Base
* @parent Detailed Settings (Leaves)
* @type number
* @min 1
* @max 15
* @desc Controls the speed of a leaf during Leaves.
* Valid: A number between 1 to 15
* @default 3
*
* @param Leaf Speed Variation
* @parent Detailed Settings (Leaves)
* @type number
* @min 0
* @max 5
* @desc Deviate leaf speed up to X value during Leaves.
* Valid: A number between 0 to 5
* @default 2
*
* @param Leaf Size Variation
* @parent Detailed Settings (Leaves)
* @type number
* @min 0
* @max 50
* @desc Deviate leaf sizes up to X% during Leaves.
* Valid: A number between 0 to 50
* @default 32
*
* @param Embers Image
* @parent Embers
* @desc Image used for embers. * Embers weather do not appear when left empty.
* Valid: Any file name.
* @default Embers
*
* @param Embers Count Minimum
* @parent Embers
* @type number
* @min 0
* @max 999
* @desc Amount of embers to create during Embers with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 20
*
* @param Embers Count Maximum
* @parent Embers
* @type number
* @min 0
* @max 999
* @desc Amount of embers to create during Embers with the magnitude of 9.
* Valid: A number between 0 to 999
* @default 160
*
* @param Embers Lifetime
* @parent Detailed Settings (Embers)
* @type number
* @min 1
* @max 80
* @desc Controls how long embers should last during Embers.
* Valid: A number between 1 to 200
* @default 33
*
* @param Embers Speed Base
* @parent Detailed Settings (Embers)
* @type number
* @min 1
* @max 60
* @desc Controls the speed of embers during Embers.
* Valid: A number between 1 to 60
* @default 30
*
* @param Embers Speed Variation
* @parent Detailed Settings (Embers)
* @type number
* @min 0
* @max 25
* @desc Deviate embers speed up to X value during Embers.
* Valid: A number between 0 to 25
* @default 25
*
* @param Embers Size Variation
* @parent Detailed Settings (Embers)
* @type number
* @min 0
* @max 50
* @desc Deviate leaf sizes up to X% during Leaves.
* Valid: A number between 0 to 50
* @default 40
*
* @param Shine Image
* @parent Shine
* @desc Image used for shining effects.
* Valid: Any file name.
* @default Shine
*
* @param Shine Count Minimum
* @parent Shine
* @type number
* @min 0
* @max 999
* @desc Amount of sparkles to create during Shine with the magnitude of 1.
* Valid: A number between 0 to 999
* @default 20
*
* @param Shine Count Maximum
* @parent Shine
* @type number
* @min 0
* @max 999
* @desc Amount of sparkles to create during Shine with the magnitude of 9.
* Valid: A number between 0 to 999
* @default 360
*
* @param Shine Lifetime
* @parent Detailed Settings (Shine)
* @type number
* @min 1
* @max 25
* @desc Controls how long sparkles should last during Shine.
* Valid: A number between 1 to 25
* @default 25
*
* @param Shine Opacity Base
* @parent Detailed Settings (Shine)
* @type number
* @min 0
* @max 255
* @desc Controls the opacity of sparkles during Shine.
* Valid: A number between 0 to 255
* @default 220
*
* @param Shine Opacity Variation
* @parent Detailed Settings (Shine)
* @type number
* @min 0
* @max 255
* @desc Deviate sparkle opacity up to X value during Shine.
* Valid: A number between 0 to 255
* @default 20
*
* @param Shine Size Variation
* @parent Detailed Settings (Shine)
* @type number
* @min 0
* @max 90
* @desc Deviate sparkle sizes up to X% during Shine.
* Valid: A number between 0 to 90
* @default 80
*/
var Aries = Aries || {};
var Imported = Imported || {};
Aries.P003_WCT = {};
Aries.P003_WCT.Param = PluginManager.parameters('Aries003_WeatherControl');
Aries.P003_WCT.RainImage = String(Aries.P003_WCT.Param["Rain Image"]);
Aries.P003_WCT.RainMin = Number(Aries.P003_WCT.Param["Raindrop Count Minimum"]);
Aries.P003_WCT.RainMax = Number(Aries.P003_WCT.Param["Raindrop Count Maximum"]);
Aries.P003_WCT.RainLife = Number(Aries.P003_WCT.Param["Raindrop Lifetime"]);
Aries.P003_WCT.RainSpeed = Number(Aries.P003_WCT.Param["Raindrop Speed"]);
Aries.P003_WCT.RainAngleC = Number(Aries.P003_WCT.Param["Raindrop Angle Base"]);
Aries.P003_WCT.RainAlphaC = Number(Aries.P003_WCT.Param["Raindrop Opacity Base"]);
Aries.P003_WCT.RainAngleV = Number(Aries.P003_WCT.Param["Raindrop Angle Variation"]);
Aries.P003_WCT.RainAlphaV = Number(Aries.P003_WCT.Param["Raindrop Opacity Variation"]);
Aries.P003_WCT.RainSizeV = Number(Aries.P003_WCT.Param["Raindrop Size Variation"]);
Aries.P003_WCT.StormImage = String(Aries.P003_WCT.Param["Storm Image"]);
Aries.P003_WCT.StormMin = Number(Aries.P003_WCT.Param["Storm Raindrop Count Minimum"]);
Aries.P003_WCT.StormMax = Number(Aries.P003_WCT.Param["Storm Raindrop Count Maximum"]);
Aries.P003_WCT.StormLife = Number(Aries.P003_WCT.Param["Storm Raindrop Lifetime"]);
Aries.P003_WCT.StormSpeed = Number(Aries.P003_WCT.Param["Storm Raindrop Speed"]);
Aries.P003_WCT.StormAngleC = Number(Aries.P003_WCT.Param["Storm Raindrop Angle Base"]);
Aries.P003_WCT.StormAlphaC = Number(Aries.P003_WCT.Param["Storm Raindrop Opacity Base"]);
Aries.P003_WCT.StormAngleV = Number(Aries.P003_WCT.Param["Storm Raindrop Angle Variation"]);
Aries.P003_WCT.StormAlphaV = Number(Aries.P003_WCT.Param["Storm Raindrop Opacity Variation"]);
Aries.P003_WCT.StormSizeV = Number(Aries.P003_WCT.Param["Storm Raindrop Size Variation"]);
Aries.P003_WCT.StormThunder = eval(Aries.P003_WCT.Param["Storm Thunder"]);
Aries.P003_WCT.StormThunderB = eval(Aries.P003_WCT.Param["Storm Thunder in Battle"]);
Aries.P003_WCT.ThunderSound = String(Aries.P003_WCT.Param["Thunder Sound"]);
Aries.P003_WCT.ThunderSEVol = Number(Aries.P003_WCT.Param["Thunder Sound Volume"]);
Aries.P003_WCT.ThunderSEPitch = Number(Aries.P003_WCT.Param["Thunder Sound Pitch"]);
Aries.P003_WCT.ThunderSEPitchV = Number(Aries.P003_WCT.Param["Thunder Sound Pitch Variation"]);
Aries.P003_WCT.ThunderWait = Number(Aries.P003_WCT.Param["Thunder Wait Time"]);
Aries.P003_WCT.ThunderWaitV = Number(Aries.P003_WCT.Param["Thunder Wait Time Variation"]);
Aries.P003_WCT.ThunderFlash = Number(Aries.P003_WCT.Param["Thunder Flash Power"]);
Aries.P003_WCT.ThunderFlashV = Number(Aries.P003_WCT.Param["Thunder Flash Variation"]);
Aries.P003_WCT.SnowImage = String(Aries.P003_WCT.Param["Snow Image"]);
Aries.P003_WCT.SnowMin = Number(Aries.P003_WCT.Param["Snow Count Minimum"]);
Aries.P003_WCT.SnowMax = Number(Aries.P003_WCT.Param["Snow Count Maximum"]);
Aries.P003_WCT.SnowLife = Number(Aries.P003_WCT.Param["Snowflake Lifetime"]);
Aries.P003_WCT.SnowSpeedC = Number(Aries.P003_WCT.Param["Snowflake Speed Base"]);
Aries.P003_WCT.SnowAlphaC = Number(Aries.P003_WCT.Param["Snowflake Opacity Base"]);
Aries.P003_WCT.SnowSpeedV = Number(Aries.P003_WCT.Param["Snowflake Speed Variation"]);
Aries.P003_WCT.SnowAlphaV = Number(Aries.P003_WCT.Param["Snowflake Opacity Variation"]);
Aries.P003_WCT.SnowSizeV = Number(Aries.P003_WCT.Param["Snowflake Size Variation"]);
Aries.P003_WCT.LeafImage = String(Aries.P003_WCT.Param["Leaf Image"]);
Aries.P003_WCT.LeafMin = Number(Aries.P003_WCT.Param["Leaf Count Minimum"]);
Aries.P003_WCT.LeafMax = Number(Aries.P003_WCT.Param["Leaf Count Maximum"]);
Aries.P003_WCT.LeafLife = Number(Aries.P003_WCT.Param["Leaf Lifetime"]);
Aries.P003_WCT.LeafSpeedC = Number(Aries.P003_WCT.Param["Leaf Speed Base"]);
Aries.P003_WCT.LeafSpeedV = Number(Aries.P003_WCT.Param["Leaf Speed Variation"]);
Aries.P003_WCT.LeafSizeV = Number(Aries.P003_WCT.Param["Leaf Size Variation"]);
Aries.P003_WCT.HeatImage = String(Aries.P003_WCT.Param["Embers Image"]);
Aries.P003_WCT.HeatMin = Number(Aries.P003_WCT.Param["Embers Count Minimum"]);
Aries.P003_WCT.HeatMax = Number(Aries.P003_WCT.Param["Embers Count Maximum"]);
Aries.P003_WCT.HeatLife = Number(Aries.P003_WCT.Param["Embers Lifetime"]);
Aries.P003_WCT.HeatSpeedC = Number(Aries.P003_WCT.Param["Embers Speed Base"]);
Aries.P003_WCT.HeatSpeedV = Number(Aries.P003_WCT.Param["Embers Speed Variation"]);
Aries.P003_WCT.HeatSizeV = Number(Aries.P003_WCT.Param["Embers Size Variation"]);
Aries.P003_WCT.MysticImage = String(Aries.P003_WCT.Param["Shine Image"]);
Aries.P003_WCT.MysticMin = Number(Aries.P003_WCT.Param["Shine Count Minimum"]);
Aries.P003_WCT.MysticMax = Number(Aries.P003_WCT.Param["Shine Count Maximum"]);
Aries.P003_WCT.MysticLife = Number(Aries.P003_WCT.Param["Shine Lifetime"]);
Aries.P003_WCT.MysticAlphaC = Number(Aries.P003_WCT.Param["Shine Opacity Base"]);
Aries.P003_WCT.MysticAlphaV = Number(Aries.P003_WCT.Param["Shine Opacity Variation"]);
Aries.P003_WCT.MysticSizeV = Number(Aries.P003_WCT.Param["Shine Size Variation"]);
var _aries_p003_pluginCommand=Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand=function(command,args){_aries_p003_pluginCommand.call(this,command,args);if(command==='AriesToggleStormThunder'){Aries.P003_WCT.toggleStormThunder(eval(args[0]))}else if(command==='AriesWeather'){$gameScreen.changeWeather(String(args[0]).toLowerCase(),args[1],args[2])}else if(command==='AriesSetWeatherImage'){Aries.P003_WCT.setWeatherImage(String(args[0]).toLowerCase(),String(args[1]).toLowerCase())}};Aries.P003_WCT.toggleStormThunder=function(flag){Aries.P003_WCT.StormThunder=flag};Aries.P003_WCT.setWeatherImage=function(weathertype,image){switch(weathertype){case 'rain':Aries.P003_WCT.RainImage=image;break;case 'storm':Aries.P003_WCT.StormImage=image;break;case 'snow':Aries.P003_WCT.SnowImage=image;break;case 'leaves':Aries.P003_WCT.LeafImage=image;break;case 'embers':Aries.P003_WCT.HeatImage=image;break;case 'shine':Aries.P003_WCT.MysticImage=image;break}
if(SceneManager._scene instanceof Scene_Map){SceneManager._scene._spriteset.refreshWeatherBitmaps()}};var _aries_p003_gameScreen_clearWeather=Game_Screen.prototype.clearWeather;Game_Screen.prototype.clearWeather=function(){_aries_p003_gameScreen_clearWeather.call(this);this._weatherWind=[0,0];this._stormThunderSound=''
this._stormThunderFlash=0;this._stormThunderCount=4*(Aries.P003_WCT.ThunderWait+Aries.P003_WCT.ThunderWaitV);this._stormThunderFrequency=0;this._snowBloom=0};var _aries_p003_gameScreen_updateWeather=Game_Screen.prototype.updateWeather;Game_Screen.prototype.updateWeather=function(){_aries_p003_gameScreen_updateWeather.call(this);if(this._weatherType==='storm'){if(Aries.P003_WCT.StormThunder===!0&&!$gameParty.inBattle()){this.updateStorm()}else if(Aries.P003_WCT.StormThunderB===!0&&$gameParty.inBattle()){this.updateStorm()}}};Game_Screen.prototype.updateStorm=function(){this._stormThunderCount-=(1+(0.5*Number(this._weatherPower)));if(this._stormThunderCount<=0){var alpha=Math.min((Aries.P003_WCT.ThunderFlash-Aries.P003_WCT.ThunderFlashV)+Math.randomInt(1+Aries.P003_WCT.ThunderFlashV*2),255);this.startFlash([255,255,255,alpha],4);if(Aries.P001_ASE!==undefined){Aries.P001_ASE.glow(18,2,3,0.75)}
this._stormThunderCount=4*((Aries.P003_WCT.ThunderWait-Aries.P003_WCT.ThunderWaitV)+Math.randomInt(1+Aries.P003_WCT.ThunderWaitV*2));thunderSound={name:Aries.P003_WCT.ThunderSound,pan:0,pitch:(Aries.P003_WCT.ThunderSEPitch-Aries.P003_WCT.ThunderSEPitchV)+Math.randomInt(1+Aries.P003_WCT.ThunderSEPitchV*2),volume:Aries.P003_WCT.ThunderSEVol};AudioManager.playStaticSe(thunderSound)}};Spriteset_Map.prototype.refreshWeatherBitmaps=function(){this._weather._createBitmaps()};Weather.prototype._createBitmaps=function(){this._createRainBitmap();this._createStormBitmap();this._createSnowBitmap();this._createLeafBitmap();this._createHeatBitmap();this._createMysticBitmap()};Weather.prototype._createRainBitmap=function(){if(Aries.P003_WCT.RainImage.length>0){this._rainBitmap=ImageManager.loadPicture(Aries.P003_WCT.RainImage)}else{this._rainBitmap=new Bitmap(1,60);this._rainBitmap.fillAll('white')}};Weather.prototype._createStormBitmap=function(){if(Aries.P003_WCT.StormImage.length>0){this._stormBitmap=ImageManager.loadPicture(Aries.P003_WCT.StormImage)}else{this._stormBitmap=new Bitmap(2,100);this._stormBitmap.fillAll('white')}};Weather.prototype._createSnowBitmap=function(){if(Aries.P003_WCT.SnowImage.length>0){this._snowBitmap=ImageManager.loadPicture(Aries.P003_WCT.SnowImage)}else{this._snowBitmap=new Bitmap(9,9);this._snowBitmap.drawCircle(4,4,4,'white')}};Weather.prototype._createLeafBitmap=function(){if(Aries.P003_WCT.LeafImage.length>0){this._leafBitmap=ImageManager.loadPicture(Aries.P003_WCT.LeafImage)}else{this._leafBitmap=new Bitmap(9,9);this._leafBitmap.drawCircle(4,4,4,'green')}};Weather.prototype._createHeatBitmap=function(){if(Aries.P003_WCT.HeatImage.length>0){this._heatBitmap=ImageManager.loadPicture(Aries.P003_WCT.HeatImage)}else{this._heatBitmap=new Bitmap(7,7);this._heatBitmap.drawCircle(3,3,3,'black')}};Weather.prototype._createMysticBitmap=function(){if(Aries.P003_WCT.MysticImage.length>0){this._mysticBitmap=ImageManager.loadPicture(Aries.P003_WCT.MysticImage)}else{this._mysticBitmap=new Bitmap(9,9);this._mysticBitmap.drawCircle(4,4,4,'white');this._mysticBitmap.rotateHue(Math.randomInt(359))}};Weather.prototype._addSprite=function(){var sprite=new Sprite_Weather(this.viewport);switch(this.type){case 'rain':var life=Aries.P003_WCT.RainLife;var size=0.01*((100-Aries.P003_WCT.RainSizeV)+Math.randomInt(1+Aries.P003_WCT.RainSizeV*2));var getangle=((Aries.P003_WCT.RainAngleC-Aries.P003_WCT.RainAngleV)+Math.randomInt(1+Aries.P003_WCT.RainAngleV*2));var alpha=((Aries.P003_WCT.RainAlphaC-Aries.P003_WCT.RainAlphaV)+Math.randomInt(1+Aries.P003_WCT.RainAlphaV*2));sprite.setUp('rain',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'storm':var life=Aries.P003_WCT.StormLife;var size=0.01*((100-Aries.P003_WCT.StormSizeV)+Math.randomInt(1+Aries.P003_WCT.StormSizeV*2));var getangle=((Aries.P003_WCT.StormAngleC-Aries.P003_WCT.StormAngleV)+Math.randomInt(1+Aries.P003_WCT.StormAngleV*2));var alpha=((Aries.P003_WCT.StormAlphaC-Aries.P003_WCT.StormAlphaV)+Math.randomInt(1+Aries.P003_WCT.StormAlphaV*2));sprite.setUp('storm',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'snow':var life=Aries.P003_WCT.SnowLife;var size=0.01*((100-Aries.P003_WCT.SnowSizeV)+Math.randomInt(1+Aries.P003_WCT.SnowSizeV*2));var getangle=(-1+Math.randomInt(3))*0.267;var alpha=((Aries.P003_WCT.SnowAlphaC-Aries.P003_WCT.SnowAlphaV)+Math.randomInt(1+Aries.P003_WCT.SnowAlphaV*2));var snowspeed=1.33+Math.randomInt(2);sprite.setUp('snow',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'leaves':var life=Aries.P003_WCT.LeafLife;var size=0.007*((100-Aries.P003_WCT.LeafSizeV)+Math.randomInt(1+Aries.P003_WCT.LeafSizeV*2));var getangle=Aries.P003_WCT.LeafSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
sprite.setUp('leaves',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'embers':var life=Aries.P003_WCT.HeatLife;var size=0.007*((100-Aries.P003_WCT.HeatSizeV)+Math.randomInt(1+Aries.P003_WCT.HeatSizeV*2));var getangle=Aries.P003_WCT.HeatSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
sprite.setUp('embers',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'shine':var life=Aries.P003_WCT.MysticLife;var size=0.007*((100-Aries.P003_WCT.MysticSizeV)+Math.randomInt(1+Aries.P003_WCT.MysticSizeV*2));var getangle=12;var alpha=((Aries.P003_WCT.MysticAlphaC-Aries.P003_WCT.MysticAlphaV)+Math.randomInt(1+Aries.P003_WCT.MysticAlphaV*2));var snowspeed=0.25*(2+Math.randomInt(3));sprite.setUp('shine',life,size,getangle,alpha,snowspeed);sprite.rotation=Math.random();sprite.opacity=0;break}
sprite.opacity=0;this._sprites.push(sprite);this.addChild(sprite)};Weather.prototype._getMaxSpriteCount=function(){var maxCount=0;switch(this.type){case 'rain':maxCount=Aries.P003_WCT.RainMin+(Aries.P003_WCT.RainMax*this.power*0.1);break;case 'storm':maxCount=Aries.P003_WCT.StormMin+(Aries.P003_WCT.StormMax*this.power*0.1);break;case 'snow':maxCount=Aries.P003_WCT.SnowMin+(Aries.P003_WCT.SnowMax*this.power*0.1);break;case 'leaves':maxCount=Aries.P003_WCT.LeafMin+(Aries.P003_WCT.LeafMax*this.power*0.1);break;case 'embers':maxCount=Aries.P003_WCT.HeatMin+(Aries.P003_WCT.HeatMax*this.power*0.1);break;case 'shine':maxCount=Aries.P003_WCT.MysticMin+(Aries.P003_WCT.MysticMax*this.power*0.1);break}
return maxCount};Weather.prototype._updateAllSprites=function(){var maxSprites=this._getMaxSpriteCount();if(this._sprites.length<maxSprites){this._addSprite()}
if(this._sprites.length>maxSprites){this._removeSprite()}
this._sprites.forEach(function(sprite){this._updateSprite(sprite);sprite.x=sprite.ax-this.origin.x;sprite.y=sprite.ay-this.origin.y},this)};Weather.prototype._updateSprite=function(sprite){sprite.update();switch(this.type){case 'rain':this._updateRainSprite(sprite);break;case 'storm':this._updateStormSprite(sprite);break;case 'snow':this._updateSnowSprite(sprite);break;case 'leaves':this._updateLeafSprite(sprite);break;case 'embers':this._updateHeatSprite(sprite);break;case 'shine':this._updateMysticSprite(sprite);break}
if(sprite._lifetime<=0&&sprite.opacity<=6){this._rebornSprite(sprite)}};Weather.prototype._updateRainSprite=function(sprite){sprite.bitmap=this._rainBitmap;sprite.rotation=sprite._anglev*(Math.PI/180);var velocity=sprite.getVelocity(Aries.P003_WCT.RainSpeed);sprite.ax+=velocity[0];sprite.ay+=velocity[1]};Weather.prototype._updateStormSprite=function(sprite){sprite.bitmap=this._stormBitmap;sprite.rotation=sprite._anglev*(Math.PI/180);var velocity=sprite.getVelocity(Aries.P003_WCT.StormSpeed);sprite.ax+=velocity[0];sprite.ay+=velocity[1]};Weather.prototype._updateSnowSprite=function(sprite){sprite.bitmap=this._snowBitmap;sprite.ax+=sprite._anglev;sprite.ay+=sprite._snowSpeed};Weather.prototype._updateLeafSprite=function(sprite){sprite.bitmap=this._leafBitmap;sprite.rotation+=0.025*sprite._anglev;sprite.ax+=2*Math.sin(0.0078*sprite._randomSeed);sprite.ay+=sprite._snowSpeed};Weather.prototype._updateHeatSprite=function(sprite){sprite.bitmap=this._heatBitmap;sprite.ax+=2*Math.sin(0.0139*sprite._randomSeed);sprite.ay-=sprite._snowSpeed};Weather.prototype._updateMysticSprite=function(sprite){sprite.bitmap=this._mysticBitmap};Weather.prototype._rebornSprite=function(sprite){sprite.ax=Math.randomInt(Graphics.width+500)-200+this.origin.x;sprite.ay=Math.randomInt(Graphics.height+600)-400+this.origin.y;switch(this.type){case 'rain':var life=Aries.P003_WCT.RainLife;var size=0.01*((100-Aries.P003_WCT.RainSizeV)+Math.randomInt(1+Aries.P003_WCT.RainSizeV*2));var getangle=((Aries.P003_WCT.RainAngleC-Aries.P003_WCT.RainAngleV)+Math.randomInt(1+Aries.P003_WCT.RainAngleV*2));var alpha=((Aries.P003_WCT.RainAlphaC-Aries.P003_WCT.RainAlphaV)+Math.randomInt(1+Aries.P003_WCT.RainAlphaV*2));sprite.setUp('rain',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'storm':var life=Aries.P003_WCT.StormLife;var size=0.01*((100-Aries.P003_WCT.StormSizeV)+Math.randomInt(1+Aries.P003_WCT.StormSizeV*2));var getangle=((Aries.P003_WCT.StormAngleC-Aries.P003_WCT.StormAngleV)+Math.randomInt(1+Aries.P003_WCT.StormAngleV*2));var alpha=((Aries.P003_WCT.StormAlphaC-Aries.P003_WCT.StormAlphaV)+Math.randomInt(1+Aries.P003_WCT.StormAlphaV*2));sprite.setUp('storm',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'snow':var life=Aries.P003_WCT.SnowLife;var size=0.01*((100-Aries.P003_WCT.SnowSizeV)+Math.randomInt(1+Aries.P003_WCT.SnowSizeV*2));var getangle=(-1+Math.randomInt(3))*0.267;var alpha=((Aries.P003_WCT.SnowAlphaC-Aries.P003_WCT.SnowAlphaV)+Math.randomInt(1+Aries.P003_WCT.SnowAlphaV*2));var snowspeed=1.33+Math.randomInt(2);sprite.setUp('snow',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'leaves':var life=Aries.P003_WCT.LeafLife;var size=0.007*((100-Aries.P003_WCT.LeafSizeV)+Math.randomInt(1+Aries.P003_WCT.LeafSizeV*2));var getangle=Aries.P003_WCT.LeafSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
sprite.setUp('leaves',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'embers':var life=Aries.P003_WCT.HeatLife;var size=0.007*((100-Aries.P003_WCT.HeatSizeV)+Math.randomInt(1+Aries.P003_WCT.HeatSizeV*2));var getangle=Aries.P003_WCT.HeatSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
sprite.setUp('embers',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'shine':var life=Aries.P003_WCT.MysticLife;var size=0.007*((100-Aries.P003_WCT.MysticSizeV)+Math.randomInt(1+Aries.P003_WCT.MysticSizeV*2));var getangle=12;var alpha=((Aries.P003_WCT.MysticAlphaC-Aries.P003_WCT.MysticAlphaV)+Math.randomInt(1+Aries.P003_WCT.MysticAlphaV*2));var snowspeed=0.25*(2+Math.randomInt(3));sprite.setUp('shine',life,size,getangle,alpha,snowspeed);sprite.rotation=Math.random();sprite.opacity=0;break}};function Sprite_Weather(){this.initialize.apply(this,arguments)}
Sprite_Weather.prototype=Object.create(Sprite.prototype);Sprite_Weather.prototype.constructor=Sprite_Weather;Sprite_Weather.prototype.initialize=function(){Sprite.prototype.initialize.call(this);this._type='none'
this._lifetime=0;this._size=0;this._anglev=0;this._alpha=0;this._snowSpeed=0;this.setUpDone=!1};Sprite_Weather.prototype.update=function(){if(this.setUpDone===!0){if(this._lifetime>0){if(this._type==='snow'){this.opacity=Math.min(this.opacity+24,this._alpha);this.scale.x=this._size;this.scale.y=this._size}else if(this._type==='shine'){this.opacity=Math.min(this.opacity+48,this._alpha);this.scale.x+=0.09;this.scale.y+=0.09}else if(this._type==='embers'){this.opacity=Math.min(this.opacity+32,this._alpha);var newTone=this.getColorTone();newTone[0]*=0.98;newTone[1]*=0.95;this.setColorTone(newTone);this.scale.x=this._size;this.scale.y=this._size}else{this.opacity=Math.min(this.opacity+72,this._alpha);this.scale.x=this._size;this.scale.y=this._size}
this._lifetime-=1;this._randomSeed-=1}else{if(this._type==='snow'){this.opacity-=16}else if(this._type==='shine'){this.opacity-=15;this.scale.x-=0.09;this.scale.y-=0.09}else if(this._type==='leaves'||this._type==='embers'){this.scale.x-=0.01;this.scale.y-=0.01;this.opacity-=8}else{this.opacity-=48}}}};Sprite_Weather.prototype.setUp=function(type,life,size,getangle,alpha,snowSpeed=0){this._type=type;this._lifetime=life+Math.randomInt(life*0.25);this._size=size;this._anglev=getangle;this._alpha=alpha;this._snowSpeed=snowSpeed;this._randomSeed=Math.randomInt(16777216);if(this._type==='shine'){this.scale.x=0;this.scale.y=0;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.ADD;this.setColorTone([Math.randomInt(2)*-255,Math.randomInt(2)*-255,Math.randomInt(2)*-255,0])}else if(this._type==='leaves'){this.scale.x=1;this.scale.y=1;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([0,0,0,0])}else if(this._type==='embers'){this.scale.x=1;this.scale.y=1;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([255,200,0,0])}else{this.scale.x=1;this.scale.y=1;this.anchor=new Point(0,0);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([0,0,0,0])}
this.setUpDone=!0};Sprite_Weather.prototype.getVelocity=function(speed){var speedX=speed*Math.cos(this._anglev*(Math.PI/180));var speedY=-1*speed*Math.sin(this._anglev*(Math.PI/180));return[speedY,speedX]};if(Aries.P001_ASE!==undefined){var _aries_p003_spritesetBase_createScreenEffectFilters=Spriteset_Base.prototype.createScreenEffectFilters;Spriteset_Base.prototype.createScreenEffectFilters=function(){_aries_p003_spritesetBase_createScreenEffectFilters.call(this);this._wct_glow_filter=new PIXI.filters.AdvancedBloomFilter();this._wct_glow_filter.enabled=!1;this._wct_glow_filter.brightness=0.5;this._wct_glow_filter.bloomScale=0.667;this._wct_glow_filter.blur=0;this._wct_glow_filter.threshold=0.05;this._filters.push(this._wct_glow_filter)};var _aries_p003_spritesetBase_updateScreenEffects=Spriteset_Base.prototype.updateScreenEffects;Spriteset_Base.prototype.updateScreenEffects=function(){_aries_p003_spritesetBase_updateScreenEffects.call(this);if(this._wct_glow_filter){switch($gameScreen.weatherType()){case 'rain':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.035*$gameScreen.weatherPower();this._wct_glow_filter.brightness=1-(0.025*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.1*$gameScreen.weatherPower();this._wct_glow_filter.threshold=0.075;this._wct_heat_filter.enabled=!1;break;case 'storm':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.05*$gameScreen.weatherPower();this._wct_glow_filter.brightness=1-(0.06*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.2*$gameScreen.weatherPower();this._wct_glow_filter.threshold=0.075;this._wct_heat_filter.enabled=!1;break;case 'snow':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.1+(0.005*$gameScreen.weatherPower());this._wct_glow_filter.brightness=1+(0.001*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.5+(0.1*$gameScreen.weatherPower());this._wct_glow_filter.threshold=0.667;this._wct_heat_filter.enabled=!1;break;case 'embers':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.2+(0.015*$gameScreen.weatherPower());+0.2*(1+Math.sin(0.03*Graphics.frameCount));this._wct_glow_filter.brightness=1;this._wct_glow_filter.blur=6+(0.1*$gameScreen.weatherPower());this._wct_glow_filter.threshold=0.75;break;default:this._wct_glow_filter.enabled=!1;this._wct_glow_filter.bloomScale=1;this._wct_glow_filter.brightness=1;this._wct_glow_filter.blur=0;this._wct_glow_filter.threshold=1;break}}}}

View file

@ -0,0 +1,496 @@
//=============================================================================
// TDS Atlas Loader
// Version: 1.3
//=============================================================================
// Add to Imported List
var Imported = Imported || {}; Imported.TDS_AtlasLoader = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {}; _TDS_.AtlasLoader = _TDS_.AtlasLoader || {};
//=============================================================================
/*:
* @plugindesc
* Atlas loading BETA.
*
* @author TDS
*
*/
//=============================================================================
//=============================================================================
// ** SceneManager
//-----------------------------------------------------------------------------
// The static class that manages scene transitions.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.AtlasLoader.SceneManager_isCurrentSceneBusy = SceneManager.isCurrentSceneBusy;
//=============================================================================
// * Determine if Current scene is busy
//=============================================================================
SceneManager.isCurrentSceneBusy = function () {
// Return true if
if (this._scene && this._nextScene) {
// If Not all atlases are loaded return true
if (!this._nextScene.areAllRequiredAtlasLoaded()) { return true; }
};
// Return Original Function
return _TDS_.AtlasLoader.SceneManager_isCurrentSceneBusy.call(this);
};
//=============================================================================
// ** AtlasManager
//-----------------------------------------------------------------------------
// This static class is used to handle bitmap fonts
//=============================================================================
function AtlasManager() { throw new Error('This is a static class'); }
//=============================================================================
// * Determine if Atlas has Data for key
//=============================================================================
AtlasManager.hasAltasData = function (key) {
if ($atlasData) { return $atlasData.source[key] !== undefined; }
return false;
};
//=============================================================================
// * Get Image Atlas Name
//=============================================================================
AtlasManager.getImageAtlasName = function (key) {
// If Atlas key Exists
if (this.hasAltasData(key)) {
// Return Atlas name
return $atlasData.source[key].atlasName;
};
// Return false
return false;
};
//=============================================================================
// * Initialize Atlas Data
//=============================================================================
AtlasManager.initAtlasData = function () {
// If Atlas is undefined
if (window['$atlasData'] === undefined) {
var path = require('path');
var fs = require('fs');
var base = path.dirname(process.mainModule.filename);
// Get Folder
var folder = '/img/atlases/';
// Get FilePath
var filePath = base + folder;
// Get Directory List
var dirList = fs.readdirSync(filePath);
// Get Atlas File
var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
// Set Atlas Data
window['$atlasData'] = data;
};
};
//=============================================================================
// * Make Bitmap
//=============================================================================
AtlasManager.makeBitmap = function (key) {
// Get Data
var data = $atlasData.source[key];
// Get Data
if (data) {
// Get Function
var func = data.makeFunction;
// If Creation Function Exists
if (data.makeFunction) {
// Return Atlas Creation Function
return AtlasManager[func.name](func.arguments);
} else {
// Create Bitmap
var bitmap = new Bitmap(data.rect.width, data.rect.height);
// Get Atlas Bitmap
var atlasBitmap = ImageManager.loadAtlas(data.atlasName);
atlasBitmap.addLoadListener(() => {
let sr = data.sourceRect;
if (!atlasBitmap.isReady()) { bitmap.fillAll('rgba(0, 255, 0, 1)') }
else { bitmap.blt(atlasBitmap, sr.x, sr.y, sr.width, sr.height, data.rect.x, data.rect.y); }
})
// Check if Atlas bitmap is ready
/*if (atlasBitmap.isReady()) {
// Get Source Rect
var sr = data.sourceRect;
// Block Transfer
bitmap.blt(atlasBitmap, sr.x, sr.y, sr.width, sr.height, data.rect.x, data.rect.y);
} else {
// Make Bitmap green if atlas is not loaded
if ($gameTemp.isPlaytest()) {
// Make Bitmap green if atlas is not loaded
bitmap.fillAll('rgba(0, 255, 0, 1)');
}
};*/
// Return bitmap
return bitmap;
};
};
// Return Empty Bitmap
return ImageManager.loadEmptyBitmap();
};
//=============================================================================
// * Make WindowSkin
//=============================================================================
AtlasManager.makeWindowSkin = function () {
// Create Bitmap
var bitmap = new Bitmap(192, 192);
// Get Atlas Bitmap
var atlasBitmap = ImageManager.loadAtlas('Atlas1');
// Fill Background Color
bitmap.fillRect(0, 0, 96, 96, 'rgba(0, 255, 0, 1)')
// Transfer Border
var cw = 10, ch = 10
bitmap.blt(atlasBitmap, 0, 0, cw, ch, 96, 0);
bitmap.blt(atlasBitmap, 10, 0, cw, ch, 96 + 96 - cw, 0);
bitmap.blt(atlasBitmap, 0, 10, cw, ch, 96, 96 - ch);
bitmap.blt(atlasBitmap, 10, 10, cw, ch, 96 + 96 - cw, 96 - ch);
bitmap.blt(atlasBitmap, 11, 0, 1, ch, 96 + cw, 0, 96 - (cw * 2))
bitmap.blt(atlasBitmap, 11, 10, 1, ch, 96 + cw, 96 - ch, 96 - (cw * 2))
bitmap.blt(atlasBitmap, 0, 11, cw, 1, 96, ch, cw, 96 - (ch * 2))
bitmap.blt(atlasBitmap, 0, 11, cw, 1, 96 + 96 - 5, ch, cw, 96 - (ch * 2))
// Transfer Colors
for (var i = 0; i < 32; i++) {
var px = (i % 20);
var py = 20 + Math.floor(i / 20);
var color = atlasBitmap.getPixel(px, py);
var dx = 96 + (i % 8) * 12;
var dy = 144 + Math.floor(i / 8) * 12;
bitmap.fillRect(dx, dy, 12, 12, color);
}
// Return Bitmap
return bitmap;
};
//=============================================================================
// * Purge All Atlas Images
//=============================================================================
AtlasManager.purgeAllAtlasImages = function (name) {
// Get Atlas Images
const altasImages = Object.entries($atlasData.source).filter(arr => arr[1].atlasName === name);
// Go through atlas images
for (var i = 0; i < altasImages.length; i++) {
// Get Key
const key = altasImages[i][0];
// Delete Cache Item
delete ImageManager._imageCache._items[key];
};
};
//=============================================================================
// * Load System Atlas Images
//=============================================================================
AtlasManager.loadSystemAtlasImages = function () {
// // If Atlas is undefined
// if (window['$atlasData'] === undefined) {
// // Get Atlas File
// var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
// // Set Atlas Data
// window['$atlasData'] = data;
// };
// // Load All Atlas Images
// this.loadAllAtlasImages();
};
//=============================================================================
// * Load All Atlas Images
//=============================================================================
AtlasManager.loadAllAtlasImages = function () {
var path = require('path');
var fs = require('fs');
var yaml = require('./js/libs/js-yaml-master')
var base = path.dirname(process.mainModule.filename);
// Get Folder
var folder = '/img/atlases/';
// Get FilePath
var filePath = base + folder;
// Get Directory List
var dirList = fs.readdirSync(filePath);
// // If Atlas is undefined
// if (window['$atlasData'] === undefined) {
// // Get Atlas File
// var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
// // Set Atlas Data
// window['$atlasData'] = data;
// };
// Go Through Directory
for (var i = 0; i < dirList.length; i++) {
// Get Directory
var directory = dirList[i];
// Get Format
var format = path.extname(dirList[i]);
// Get Filename
var filename = path.basename(directory, format);
// If an image
if (format === '.png') {
// Load Atlas
ImageManager.loadAtlas(filename)
};
};
};
// Initialize Atlas Data
//AtlasManager.initAtlasData()
//=============================================================================
// ** ImageManager
//-----------------------------------------------------------------------------
// The static class that loads images, creates bitmap objects and retains them.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.AtlasLoader.ImageManager_loadNormalBitmap = ImageManager.loadNormalBitmap;
_TDS_.AtlasLoader.ImageManager_requestNormalBitmap = ImageManager.requestNormalBitmap
_TDS_.AtlasLoader.ImageManager_loadBitmap = ImageManager.loadBitmap;
_TDS_.AtlasLoader.ImageManager_reserveBitmap = ImageManager.reserveBitmap;
//=============================================================================
// * Load Atlas Image
//=============================================================================
ImageManager.loadAtlas = function (filename, hue) { return this.reserveBitmap('img/atlases/', filename, hue, false, 'atlas'); };
//=============================================================================
// * Load Atlas Bitmap
//=============================================================================
ImageManager.loadAtlasBitmap = function (filename) {
return this.reserveNormalBitmap(filename, 0, 'atlas');
};
//=============================================================================
// * Load Atlas Key Bitmap
//=============================================================================
ImageManager.loadAtlasKeyBitmap = function (key) {
// Get Decoded Key
var dkey = decodeURIComponent(key);
// If Atlas manager has key
if (AtlasManager.hasAltasData(dkey)) {
// Get Bitmap
var bitmap = this._imageCache.get(key);
// If There's no bitmap and there's atlas data for it
if (!bitmap) {
// Make Bitmap
bitmap = AtlasManager.makeBitmap(dkey);
bitmap.smooth = false;
// Add to Image Cache
this._imageCache.add(key, bitmap);
// Return Bitmap
return bitmap;
};
// Return Bitmap
return bitmap;
};
// Return null
return null;
};
//=============================================================================
// * Load Bitmap
//=============================================================================
ImageManager.loadBitmap = function (folder, filename, hue, smooth) {
// If Filename is valid
if (filename) {
// Get Path
const loadFileName = replaceSpecialSymbols(filename);
var path = (folder + encodeURIComponent(loadFileName) + '.png').trim();
// Get Atlas Key Bitmap
var bitmap = this.loadAtlasKeyBitmap(encodeURI(path));
// Return bitmap if not null
if (bitmap !== null) { return bitmap; };
};
// Return Original Function
return _TDS_.AtlasLoader.ImageManager_loadBitmap.call(this, folder, filename, hue, smooth);
};
//=============================================================================
// * Reserve Bitmap
//=============================================================================
ImageManager.reserveBitmap = function (folder, filename, hue, smooth, reservationId) {
// If Filename is valid
if (filename) {
// Get Path
var path = folder + filename + '.png';
path = replaceSpecialSymbols(path);
// Get Atlas Key Bitmap
var bitmap = this.loadAtlasKeyBitmap(path);
// Return bitmap if not null
if (bitmap !== null) { return bitmap; };
};
// Return Original Function
return _TDS_.AtlasLoader.ImageManager_reserveBitmap.call(this, folder, filename, hue, smooth, reservationId);
};
//=============================================================================
// * Load Normal Bitmap
//=============================================================================
ImageManager.loadNormalBitmap = function (path, hue) {
// Get Atlas Key Bitmap
var bitmap = this.loadAtlasKeyBitmap(replaceSpecialSymbols(path));
// Return bitmap if not null
if (bitmap !== null) { return bitmap; };
// Return Original Function
return _TDS_.AtlasLoader.ImageManager_loadNormalBitmap.call(this, path, hue);
};
//=============================================================================
// * Request Normal Bitmap
//=============================================================================
ImageManager.requestNormalBitmap = function (path, hue) {
// Get Atlas Key Bitmap
var bitmap = this.loadAtlasKeyBitmap(path);
// Return bitmap if not null
if (bitmap !== null) { return bitmap; };
// Return Original Function
return _TDS_.AtlasLoader.ImageManager_requestNormalBitmap.call(this, path, hue);
};
// Load All Atlas Images (Yes for some reason it needs to be just here to work)
// AtlasManager.loadAllAtlasImages();
AtlasManager.loadSystemAtlasImages()
//=============================================================================
// ** Scene_Boot
//-----------------------------------------------------------------------------
// The scene class for initializing the entire game.
//=============================================================================
// * Determine if Scene is Busy
//=============================================================================
Scene_Boot.prototype.isBusy = function () {
// If Image Manager is not ready return true
if (!ImageManager.isReady()) { return true; }
// Super Call
return Scene_Base.prototype.isBusy.call(this);
};
//=============================================================================
// ** Scene_Base
//-----------------------------------------------------------------------------
// The Superclass of all scene within the game.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.AtlasLoader.Scene_Base_initialize = Scene_Base.prototype.initialize;
_TDS_.AtlasLoader.Scene_Base_terminate = Scene_Base.prototype.terminate
//=============================================================================
// * Determine if Scene is Busy
//=============================================================================
Scene_Base.prototype.initialize = function () {
// Load Reserved Bitmaps
this.loadReservedBitmaps();
// Run Original Function
_TDS_.AtlasLoader.Scene_Base_initialize.call(this);
// Initialize Atlas List
this.initAtlastLists();
// Load Required Atlas Images
this.loadRequiredAtlasImages();
};
//=============================================================================
// * Terminate the scene before switching to a another scene.
//=============================================================================
Scene_Base.prototype.terminate = function () {
// Run Original Function
_TDS_.AtlasLoader.Scene_Base_terminate.call(this);
// Dump Required Atlases
this.dumpRequiredAtlas();
}
//=============================================================================
// * Load Reserved Bitmaps
//=============================================================================
Scene_Base.prototype.loadReservedBitmaps = function () { };
//=============================================================================
// * Initialize Atlas Lists
//=============================================================================
Scene_Base.prototype.initAtlastLists = function () {
// List of Atlases require for the scene to start
this._requiredAtlasList = [];
// List of Atlases to dump when scene is done
this._dumpAtlasList = []
// All Atlas Loaded Flag
this._allAtlasLoaded = false;
};
//=============================================================================
// * Add Required Atlas
//=============================================================================
Scene_Base.prototype.addRequiredAtlas = function (name, dump = true) {
// If Required Atlast list does not contain name
if (!this._requiredAtlasList.contains(name)) {
// Add it to required atlas list
this._requiredAtlasList.push(name);
};
// If Dump and Dump atlas list does not contain name
if (dump && !this._dumpAtlasList.contains(name)) {
// Add it to dump atlas list
this._dumpAtlasList.push(name);
};
};
//=============================================================================
// * Load Required Atlas Images
//=============================================================================
Scene_Base.prototype.loadRequiredAtlasImages = function () {
// Go Through Required Atlas List
for (var i = 0; i < this._requiredAtlasList.length; i++) {
ImageManager.loadAtlas(this._requiredAtlasList[i]);
};
};
//=============================================================================
// * Dump Required Atlas Images
//=============================================================================
Scene_Base.prototype.dumpRequiredAtlas = function () {
// Initialize Dump List
var dumpList = this._dumpAtlasList.clone();
// Get Next Scene
var nextScene = SceneManager._nextScene;
// If Next Scene Exists
if (nextScene) {
// Get Required Atlas List from Next Scene
var nextRequiredAtlasList = nextScene._requiredAtlasList;
// Go through required Atlas list
for (var i = 0; i < nextRequiredAtlasList.length; i++) {
// Get Index in dump list
var index = dumpList.indexOf(nextRequiredAtlasList[i]);
// Remove fro Dump list if it exists
if (index >= 0) { dumpList.splice(index, 1); };
};
};
// Go Through Dump List
for (var i = 0; i < dumpList.length; i++) {
// Get Atlas Name
var atlasName = dumpList[i];
// Get Atlas Key
var key = 'img/atlases/' + atlasName + '.png:0'
// Delete Cache Item
delete ImageManager._imageCache._items[key];
};
};
//=============================================================================
// * Check if all required atlases are loaded
//=============================================================================
Scene_Base.prototype.areAllRequiredAtlasLoaded = function () {
// If Atlas loading has not started return false
if (this._allAtlasLoaded) { return true; }
// Set Loaded Flag
var loaded = true;
// Go Through Required Atlas List
for (var i = 0; i < this._requiredAtlasList.length; i++) {
// Get Bitmap
var bitmap = ImageManager.loadAtlas(this._requiredAtlasList[i]);
// If Bitmap Loading state is not loaded
if (bitmap._loadingState !== 'loaded') {
// Set loaded flag to false
loaded = false;
break
};
};
// Set Loaded flag to false
if (!ImageManager.isReady()) { loaded = false; }
// If Loaded set All Atlas loaded flag to true
if (loaded) { this._allAtlasLoaded = true; };
// Return loaded flag
return loaded;
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,402 @@
//=============================================================================
// TDS Battle Commands List
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_BattleCommandsList = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.BattleCommandsList = _TDS_.BattleCommandsList || {};
//=============================================================================
/*:
* @plugindesc
* This plugin allows you to set custom battle commands for actors and classes.
*
* @author TDS
* @param Skill Type Names
* @desc Names of skill types. (Used for skill list commands) (Use a , to separate and leave empty for default name.)
* @default
*
* @help
* ============================================================================
* * Actor & Class Notetags
* ============================================================================
* Use the following note tags within the actor or class note boxes to
* set the command list for the actor or class. (Actor note tags will
* override class tags.)
*
* <BattleCommandsList>
* Command
* </BattleCommandsList>
*
* Example:
*
* <BattleCommandsList>
* attack
* defend
* skillList
* skillTypeList: 1
* skill: 10
* items
* item: 2
* </BattleCommandsList>
*
* Command List:
*
* attack
* ^ Adds default attack command to the commmand list.
*
* defend
* ^ Adds default defense command to the command list.
*
* skillList
* ^ Adds default skill command to the command list. (Shows all skills)
*
* skillTypeList: SkillTypeId
* ^ Adds a skill list command which only shows a type of skill.
* ^ SkillTypeId: Id of the type of skill to show.
*
* skill: ID
* ^ Adds a skill as a command.
* ^ ID: Id of the skill to set as a command.
*
* items
* ^ Adds default item command to the command list. (Shows all items)
*
* item: ID
* ^ Adds an item as a command.
* ^ ID: ID of the item to set as a command.
*
* ============================================================================
* * Skill & Item Notetags
* ============================================================================
* These note tags will modify how items and skills are displayed or used
* in the command window.
*
* <CommandName: NAME>
* ^ This note tag allows you to set a display name for a skill or item
* when it is being displayed as a command.
* ^ NAME: Name to use as a command.
*
* Example:
* <CommandName: Limit break>
*
*
* <CommandHideUntilSwitch: ID>
* ^ This note tag makes it so if a switch is not on the item or skill
* will not be displayed in the command list.
* ^ ID: ID of the switch to use.
*
* Example:
* <CommandHideUntilSwitch: 5>
*
*
* <CommandHideUntilUsable>
* ^ This note tag makes it so if an item or skill cannot be used by
* the actor it will not be displayed in the command list.
*
*
* <CommandHideUntilLearned>
* ^ This note tag makes it so if a skill has not been learned by the
* actor it will not be displayed in the command list.
*/
//=============================================================================
// Node.js path
var path = require('path');
// Get Parameters
var parameters = PluginManager.parameters("Battle Commands List");
// Initialize After Battle Commmon Event Parameters
_TDS_.BattleCommandsList.params = {};
// Skill Type Custom Names
_TDS_.BattleCommandsList.params.sTypeNames = [''];
// Get Text
var text = parameters['Skill Type Names'];
// If Text is not empty
if (text !== '') {
// Create List
var list = text.split(/,/);
// Go through List
for (var i = 0; i < list.length; i++) {
// Add Skill Type Name
_TDS_.BattleCommandsList.params.sTypeNames.push(list[i].trim());
}
}
//=============================================================================
// ** DataManager
//-----------------------------------------------------------------------------
// The static class that manages the database and game objects.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.BattleCommandsList.DataManager_onLoad = DataManager.onLoad;
//=============================================================================
// * On Load Processing
//=============================================================================
DataManager.onLoad = function(object) {
// Run Original Function
_TDS_.BattleCommandsList.DataManager_onLoad.call(this, object);
// Set Array & Type
var array = object, type = null;
// Object Switch
switch (object) {
case $dataActors: type = 'ACTOR' ;break;
// case $dataClasses: type = 'CLASS' ;break;
// case $dataItems: type = 'ITEM' ;break;
// case $dataSkills: type = 'SKILL' ;break;
}
// If Type is not null
if (type !== null) {
// If Array is an array
if (Array.isArray(array)) {
// Go Through Array
for (var i = 0; i < array.length; i++) {
// Get Data
var data = array[i];
// Extract MetaData
if (data) { this.extractActorBattleListMetaData(data, type); }
}
}
}
};
//=============================================================================
// * Extract Meta Data
//=============================================================================
DataManager.extractActorBattleListMetaData = function(data, type) {
// If Data has no notes return
if (data.note.length <= 0) { return; }
// If Type is Actor
if (type === 'ACTOR' || type === 'CLASS') {
// If Data Meta has Info Text
// Get Regexp
var noteData = data.note.split(/[\r\n]+/);
var regS = /<BattleCommandsList>/i, regE = /<\/BattleCommandsList>/;
// Set Addline Flag to false
var addLine = false;
// Convert Battle Command List
data.meta.BattleCommandsList = [];
// Go Through Note Data
for (var i = 0; i < noteData.length; i++) {
var line = noteData[i];
if (line.match(regS)) { addLine = true ; continue ;}
if (line.match(regE)) { addLine = false ; continue ;}
// If add line flag is true
if (addLine) {
var commandData = line.split(/:/i);
data.meta.BattleCommandsList.push({ type: commandData[0].toLowerCase(), id: Number(commandData[1]) })
}
}
}
};
//=============================================================================
// ** Game_Actor
//-----------------------------------------------------------------------------
// The game object class for an actor.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.BattleCommandsList.Game_Actor_setup = Game_Actor.prototype.setup;
//=============================================================================
// * Setup
//=============================================================================
Game_Actor.prototype.setup = function(actorId) {
// Run Original Function
_TDS_.BattleCommandsList.Game_Actor_setup.call(this, actorId);
// Initialize Battle Command List
this.initBattleCommandsList();
};
//=============================================================================
// * Initialize Actor Battle Commands List
//=============================================================================
Game_Actor.prototype.initBattleCommandsList = function() {
// Get Actor & Current Class
var actor = this.actor(), currentClass = this.currentClass();
// Find Corrent Battle Command List
if (actor.meta.BattleCommandsList) {
// Set Battle Command List
this._battleCommandsList = actor.meta.BattleCommandsList.clone();
} else if (currentClass.meta.BattleCommandsList) {
// Set Battle Command List
this._battleCommandsList = currentClass.meta.BattleCommandsList.clone();
} else {
// Set Battle Command List
this._battleCommandsList = []
}
};
//=============================================================================
// * Determine if Battler has custom battle commands
//=============================================================================
Game_Actor.prototype.hasCustomBattleCommands = function() { return this._battleCommandsList.length > 0; };
//=============================================================================
// * Get Actor Battle Commands List
//=============================================================================
Game_Actor.prototype.battleCommandsList = function() { return this._battleCommandsList; };
//=============================================================================
// * Determine if Actor can show item battle command
//=============================================================================
Game_Actor.prototype.canShowItemBattleCommand = function(item) {
if (item.meta.CommandHideUntilUsable && !this.canUse(item)) { return false; };
if (item.meta.CommandHideUntilLearned && !this.isLearnedSkill(item.id)) { return false; };
if (item.meta.CommandHideUntilSwitch && !$gameSwitches.value(Number(item.meta.CommandHideUntilSwitch))) { return false; };
// Return true by default
return true;
};
//=============================================================================
// ** Window_ActorCommand
//-----------------------------------------------------------------------------
// The window for selecting an actor's action on the battle screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.BattleCommandsList.Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList;
//=============================================================================
// * Make Command List
//=============================================================================
Window_ActorCommand.prototype.makeCommandList = function() {
// If Actor has Custom Battle Commands
if (this._actor && this._actor.hasCustomBattleCommands()) {
// Make Custom Actor Command List
this.makeCustomActorCommandList();
return;
};
// Run Original Function
_TDS_.BattleCommandsList.Window_ActorCommand_makeCommandList.call(this);
};
//=============================================================================
// * Make Custom Actor Command List
//=============================================================================
Window_ActorCommand.prototype.makeCustomActorCommandList = function() {
// Get Actor
var actor = this._actor;
// Get Actor Battle Commands List
var list = actor.battleCommandsList();
// Go Through List
for (var i = 0; i < list.length; i++) { this.addActorCustomCommand(list[i]); };
};
//=============================================================================
// * Add Actor Custom Command
//=============================================================================
Window_ActorCommand.prototype.addActorCustomCommand = function(obj) {
// Get Actor
var actor = this._actor;
// Object type case
switch (obj.type.toLowerCase()) {
case 'attack': this.addAttackCommand() ;break;
case 'skilllist': this.addSkillCommands() ;break;
case 'defend': this.addGuardCommand() ;break;
case 'items': this.addItemCommand() ;break;
case 'skilltypelist':
var stypeId = obj.id;
var presetName = _TDS_.BattleCommandsList.params.sTypeNames[stypeId];
// If Stype Names is not ''
if (presetName && presetName !== '') {
var name = presetName;
} else {
var name = $dataSystem.skillTypes[stypeId];
}
this.addCommand(name, 'skill', true, stypeId);
break;
case 'skill':
// Get Skill
var skill = $dataSkills[obj.id];
// If Skill command can be shown
if (actor.canShowItemBattleCommand(skill)) {
// Get Skill Name
var name = (skill.meta.CommandName || skill.name).trim();
// Add Command
this.addCommand(name, 'actionSkill', actor.canUse(skill), skill.id);
}
break;
case 'item':
// Get Skill
var item = $dataItems[obj.id];
// If Item command can be shown
if (actor.canShowItemBattleCommand(item)) {
// Get Item Name
var name = (item.meta.CommandName || item.name).trim();
// Add Command
this.addCommand(name, 'actionItem', actor.canUse(item), item.id);
}
break;
default:
this.addCommand('ERROR', 'ERROR', false);
break;
}
};
//=============================================================================
// ** Scene_Battle
//-----------------------------------------------------------------------------
// The scene class of the battle screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.BattleCommandsList.Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
_TDS_.BattleCommandsList.Scene_Battle_onEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
_TDS_.BattleCommandsList.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel;
//=============================================================================
// * Create Actor Command Window
//=============================================================================
Scene_Battle.prototype.createActorCommandWindow = function() {
// Run Original Function
_TDS_.BattleCommandsList.Scene_Battle_createActorCommandWindow.call(this);
// Set Actor Command Window Handlers
this._actorCommandWindow.setHandler('actionSkill', this.commandActorCommandAction.bind(this));
this._actorCommandWindow.setHandler('actionItem', this.commandActorCommandAction.bind(this));
};
//=============================================================================
// * On Enemy Cancel
//=============================================================================
Scene_Battle.prototype.onEnemyCancel = function() {
// Run Original Function
_TDS_.BattleCommandsList.Scene_Battle_onEnemyCancel.call(this);
switch (this._actorCommandWindow.currentSymbol()) {
case 'actionSkill':
this._actorCommandWindow.activate();
break;
case 'actionItem':
this._actorCommandWindow.activate();
break;
}
};
//=============================================================================
// * On Actor Cancel
//=============================================================================
Scene_Battle.prototype.onActorCancel = function() {
// Run Original Function
_TDS_.BattleCommandsList.Scene_Battle_onActorCancel.call(this);
switch (this._actorCommandWindow.currentSymbol()) {
case 'actionSkill':
this._actorCommandWindow.activate();
break;
case 'actionItem':
this._actorCommandWindow.activate();
break;
}
};
//=============================================================================
// * Create Actor Command Window
//=============================================================================
Scene_Battle.prototype.commandActorCommandAction = function() {
var symbol = this._actorCommandWindow.currentSymbol();
var id = this._actorCommandWindow.currentExt();
var action = BattleManager.inputtingAction();
if (symbol === 'actionSkill') { action.setSkill(id); }
if (symbol === 'actionItem') { action.setItem(id); }
this.onSelectAction();
}

View file

@ -0,0 +1,447 @@
//=============================================================================
// TDS Character Movement Graphics
// Version: 1.5
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_CharacterMovementGraphics = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.CharacterMovementGraphics = _TDS_.CharacterMovementGraphics || {};
//=============================================================================
/*:
* @plugindesc
* This plugins let's you set special graphics for character movements such as:
* idle, walking, and running.
*
* @author TDS
*
* @help
*
* Use the following in a script call to set the movement graphics for an
* actor:
*
* $gameActors.actor(actorId).setMovementGraphics(idle, walking, running);
* ^ actorId: Actor database ID.
* ^ idle: Graphics name for idle. (Not moving)
* ^ walking: Graphics name for walking. (Normal walking)
* ^ running: Graphics name for running. (Moving and Dashing at the same time)
*
* Example:
*
* $gameActors.actor(1).setMovementGraphics('$NormalMale', '$NormalMale', '$Teen_Male%(8)');
*
*
* Use the following in a script call to clear he movement graphics for an
* actor:
*
* $gameActors.actor(actorId).clearMovementGraphics();
* ^ actorId: Actor database ID.
*
* Example:
*
* $gameActors.actor(1).clearMovementGraphics();
*
*/
//=============================================================================
//=============================================================================
// ** Game_Actor
//-----------------------------------------------------------------------------
// The game object class for an actor.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CharacterMovementGraphics.Game_Actor_initMembers = Game_Actor.prototype.initMembers;
//=============================================================================
// * Initialize Members
//=============================================================================
Game_Actor.prototype.initMembers = function() {
// Run Original Function
_TDS_.CharacterMovementGraphics.Game_Actor_initMembers.call(this);
// Initialize Character Movement Graphics
this._characterMovementGraphics = {};
};
//=============================================================================
// * Set Movement Graphics
//=============================================================================
Game_Actor.prototype.setMovementGraphics = function(idle, walking, running) {
// Set Character Movement Graphics
this.setMovementGraphicData('idle', idle);
this.setMovementGraphicData('walking', walking);
this.setMovementGraphicData('running', running);
};
//=============================================================================
// * Set Movement Graphic Data
//=============================================================================
Game_Actor.prototype.setMovementGraphicData = function(name, data) {
// Set Default Data
if (typeof data === 'string') { data = { name: data, index: 1 }; };
// Set Character Movement Graphics Data
this._characterMovementGraphics[name.toLowerCase()] = data;
};
//=============================================================================
// * Clear Movement Graphics
//=============================================================================
Game_Actor.prototype.clearMovementGraphics = function() {
// Delete Character Movement Graphics
delete this._characterMovementGraphics;
// Initialize Character Movement Graphics
this._characterMovementGraphics = {};
};
//=============================================================================
// ** Game_CharacterBase
//-----------------------------------------------------------------------------
// The superclass of Game_Character. It handles basic information, such as
// coordinates and images, shared by all characters.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CharacterMovementGraphics.Game_CharacterBase_update = Game_CharacterBase.prototype.update;
//=============================================================================
// * Frame Update
//=============================================================================
Game_CharacterBase.prototype.update = function() {
// Run Original Function
_TDS_.CharacterMovementGraphics.Game_CharacterBase_update.call(this);
// Update Movement Graphics
this.updateMovementGraphics();
};
//=============================================================================
// * Determine if Movement Graphic should be updated
//=============================================================================
Game_CharacterBase.prototype.canUpdateMovementGraphics = function() { return false; };
//=============================================================================
// * Determine if running graphic should be used
//=============================================================================
Game_CharacterBase.prototype.shouldUseRunningGraphics = function() { return false; }
//=============================================================================
// * Determine if Character is climbing
//=============================================================================
Game_CharacterBase.prototype.isClimbing = function() { return this.regionId() === 90; };
//=============================================================================
// * Get Movement Graphics Source
//=============================================================================
Game_CharacterBase.prototype.movementGraphicsSource = function() { return null };
//=============================================================================
// * Update Movement Graphics
//=============================================================================
Game_CharacterBase.prototype.updateMovementGraphics = function() {
// If Normal
if (this.canUpdateMovementGraphics()) {
// Get Actor
var actor = this.movementGraphicsSource();
// If Actor Exists
if (actor) {
// Get Graphics
var graphics = actor._characterMovementGraphics;
// Get Character Graphic Name
var characterName = this.characterName();
// Get character index
var characterIndex = this.characterIndex();
// If Moving
if (this.isMoving()) {
// If Climbing
if (this.isClimbing()) {
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (this.shouldUseRunningGraphics()) {
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
let bitmap = ImageManager.loadCharacter(graphics.running.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.running.name, graphics.running.index);
}
} else {
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.walking.name, graphics.walking.index);
}
};
};
} else {
// If Climbing
if (this.isClimbing()) {
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.idle.name, graphics.idle.index);
}
}
}
}
};
// Update Toast
this.updateToast();
};
//=============================================================================
// * Update Toast
//=============================================================================
Game_CharacterBase.prototype.updateToast = function() {
// Get Actor
var actor = this.movementGraphicsSource();
// If Actor exists
if (actor) {
// If Switch 12 is on
if ($gameSwitches.value(12) === true) {
// If Actor is dead
if (actor.isDead()) {
// Get Character Graphic Name
var characterName = this.characterName();
// If not on Toasted
if (characterName !== '$Toasted') { this.setImage("$Toasted", 0); }
this.setStepAnime(true);
} else {
this.setStepAnime(false);
};
};
}
};
//=============================================================================
// ** Game_Player
//-----------------------------------------------------------------------------
// The game object class for the player. It contains event starting
// determinants and map scrolling functions.
//=============================================================================
// * Determine if Movement Graphic should be updated
//=============================================================================
Game_Player.prototype.canUpdateMovementGraphics = function() { return this.isNormal() && this.movementGraphicsSource().isAlive(); };
//=============================================================================
// * Get Movement Graphics Source
//=============================================================================
Game_Player.prototype.movementGraphicsSource = function() { return $gameParty.leader(); };
//=============================================================================
// * Determine if running graphic should be used
//=============================================================================
Game_Player.prototype.shouldUseRunningGraphics = function() { return this.isDashing(); }
Game_Player.prototype.getFollowers = function() {
return this._followers;
};
Game_Followers.prototype.getFollowerById = function(id) {
// Go Through Data
for (var i = 0; i < this._data.length; i++) {
// Get Follower
var follower = this._data[i];
// If Follower Graphics Data matches the ID
if (follower._graphicsData && follower._graphicsData.id === id) {
return follower;
};
};
return null;
};
//=============================================================================
// ** Game_Follower
//-----------------------------------------------------------------------------
// The game object class for a follower. A follower is an allied character,
// other than the front character, displayed in the party.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CharacterMovementGraphics.Game_Follower_initialize = Game_Follower.prototype.initialize;
Game_Follower.prototype.initialize = function(memberIndex) {
_TDS_.CharacterMovementGraphics.Game_Follower_initialize.call(this, memberIndex);
this._characterMovementGraphics = null;
this._hasCharacterMovementGraphics = false;
};
_TDS_.CharacterMovementGraphics.Game_Follower_update = Game_Follower.prototype.update;
//=============================================================================
// * Determine if Movement Graphic should be updated
//=============================================================================
Game_Follower.prototype.canUpdateMovementGraphics = function() {
// Get Source
var source = this.movementGraphicsSource();
// Return if source exists and is alive
if (source) {
return $gamePlayer.isNormal() && this.isVisible() && source && source.isAlive();
} else {
return this._graphicsData && this._graphicsData.id && this._hasCharacterMovementGraphics;
}
};
//=============================================================================
// * Get Movement Graphics Source
//=============================================================================
Game_Follower.prototype.movementGraphicsSource = function() { return this.actor() };
//=============================================================================
// * Determine if running graphic should be used
//=============================================================================
Game_Follower.prototype.shouldUseRunningGraphics = function() { return $gamePlayer.isDashing(); }
//=============================================================================
// * Determine if running graphic should be used
//=============================================================================
Game_Follower.prototype.update = function() {
// Run Original Version
_TDS_.CharacterMovementGraphics.Game_Follower_update.call(this);
// Update Toast
this.updateToast();
};
//=============================================================================
// * Set Movement Graphics
//=============================================================================
Game_Follower.prototype.setMovementGraphics = function(idle, walking, running) {
// Set Character Movement Graphics
if (!this._characterMovementGraphics) this._characterMovementGraphics = {};
this._hasCharacterMovementGraphics= true;
this.setMovementGraphicData('idle', idle);
this.setMovementGraphicData('walking', walking);
this.setMovementGraphicData('running', running);
};
//=============================================================================
// * Set Movement Graphic Data
//=============================================================================
Game_Follower.prototype.setMovementGraphicData = function(name, data) {
if (!this._characterMovementGraphics) this._characterMovementGraphics = {};
// Set Default Data
if (typeof data === 'string') { data = { name: data, index: 1 }; };
// Set Character Movement Graphics Data
this._characterMovementGraphics[name.toLowerCase()] = data;
};
//=============================================================================
// * Clear Movement Graphics
//=============================================================================
Game_Follower.prototype.clearMovementGraphics = function() {
// Delete Character Movement Graphics
delete this._characterMovementGraphics;
// Initialize Character Movement Graphics
this._characterMovementGraphics = null;
this._hasCharacterMovementGraphics = false;
};
Game_Follower.prototype.updateMovementGraphics = function() {
// If Normal
if (this.canUpdateMovementGraphics()) {
// Get Actor
var actor = this.movementGraphicsSource();
// If Actor Exists
if (actor) {
// Get Graphics
var graphics = actor._characterMovementGraphics;
// Get Character Graphic Name
var characterName = this.characterName();
// Get character index
var characterIndex = this.characterIndex();
// If Moving
if (this.isMoving()) {
// If Climbing
if (this.isClimbing()) {
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
}
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (this.shouldUseRunningGraphics()) {
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
let bitmap = ImageManager.loadCharacter(graphics.running.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.running.name, graphics.running.index);
}
} else {
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.walking.name, graphics.walking.index);
}
};
};
} else {
// If Climbing
if (this.isClimbing()) {
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
}
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.idle.name, graphics.idle.index);
}
}
}
} else if (this._characterMovementGraphics) {
// Get Graphics
var graphics = this._characterMovementGraphics;
// Get Character Graphic Name
var characterName = this.characterName();
// Get character index
var characterIndex = this.characterIndex();
// If Moving
if (this.isMoving()) {
// If Climbing
if (this.isClimbing()) {
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
}
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (this.shouldUseRunningGraphics()) {
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
let bitmap = ImageManager.loadCharacter(graphics.running.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.running.name, graphics.running.index);
}
} else {
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.walking.name, graphics.walking.index);
}
};
};
} else {
// If Climbing
if (this.isClimbing()) {
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
}
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.climbing.name, graphics.climbing.index);
}
} else {
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
if(!bitmap.isReady()) {return;}
this.setImage(graphics.idle.name, graphics.idle.index);
}
}
}
}
};
// Update Toast
this.updateToast();
};

View file

@ -0,0 +1,266 @@
/*:
* @plugindesc Basic plugin for manipulating important parameters.
* @author RM CoreScript team
*
* @help
* Basic plugin for manipulating important parameters.
* There is no plugin command.
*
* Caching images improves performance but increases memory allocation.
* On mobile devices, a lot of memory allocation causes the browser to crash.
* Therefore, the upper limit of memory allocation is set with cacheLimit.
*
* If you want to regain high performance, just increase cacheLimit.
* There is no need to revert to 1.4.
*
* @param cacheLimit
* @type number
* @desc The upper limit of images' cached size (MPixel)
* @default 10
*
* @param screenWidth
* @type number
* @desc The resolution of screen width
* @default 816
*
* @param screenHeight
* @type number
* @desc The resolution of screen height
* @default 624
*
* @param changeWindowWidthTo
* @type number
* @desc If set, change window width to this value
*
* @param changeWindowHeightTo
* @type number
* @desc If set, change window height to this value
*
* @param renderingMode
* @type select
* @option canvas
* @option webgl
* @option auto
* @desc The rendering mode (canvas/webgl/auto)
* @default auto
*
* @param alwaysDash
* @type boolean
* @desc The initial value whether the player always dashes (on/off)
* @on ON
* @off OFF
* @default false
*
* @param textSpeed
* @type number
* @desc The text speed on "Show Text". The larger this parameter is, the slower text speed. (0: show all texts at once)
* @default 1
*
* @param enableProgressBar
* @type boolean
* @desc Show progress bar when it takes a long time to load resources
* @default true
*
* @param maxRenderingFps
* @type number
* @desc The maximum value of rendering frame per seconds (0: unlimited)
* @default 0
*/
/*:ja
* @plugindesc 基本的なパラメーターを設定するプラグインです
* @author RM CoreScript team
*
* @help
* 基本的なパラメーターを設定するプラグインです
* このプラグインにはプラグインコマンドはありません
*
* 画像をキャッシュするとパフォーマンスは向上しますがその分メモリ確保も増大します
* モバイルデバイスではたくさんのメモリ確保はブラウザをクラッシュさせます
* そこでメモリ確保の上限を画像キャッシュ上限値で設定しています
*
* もし高いパフォーマンスを取り戻したければただ画像キャッシュ上限値を増加させればよいです
* 1.4に戻す必要はありません
*
* @param cacheLimit
* @type number
* @text 画像キャッシュ上限値
* @desc 画像のメモリへのキャッシュの上限値 (MPix)
* @default 10
*
* @param screenWidth
* @type number
* @text ゲーム画面の幅
* @default 816
*
* @param screenHeight
* @type number
* @text ゲーム画面の高さ
* @default 624
*
* @param changeWindowWidthTo
* @type number
* @text ウィンドウの幅
* @desc 値が設定されなかった場合ゲーム画面の幅と同じ
*
* @param changeWindowHeightTo
* @type number
* @text ウィンドウの高さ
* @desc 値が設定されなかった場合ゲーム画面の高さと同じ
*
* @param renderingMode
* @type select
* @option canvas
* @option webgl
* @option auto
* @text レンダリングモード
* @default auto
*
* @param alwaysDash
* @type boolean
* @text 常時ダッシュの初期値
* @on ON
* @off OFF
* @default false
*
* @param textSpeed
* @type number
* @text 文章の表示のスピード
* @desc 数字が大きいほど文章の表示スピードが遅くなります (0を指定した場合は一度に全文を表示します)
* @default 1
*
* @param autoSaveFileId
* @type number
* @text オートセーブ番号
* @desc 場所移動の際に指定したファイル番号にオートセーブします0を指定した場合はオートセーブしません
* @default 0
*
* @param errorMessage
* @type string
* @text エラーメッセージ
* @desc エラー時にプレイヤーに向けて表示するメッセージです
* @default エラーが発生しましたゲームの作者にご連絡ください
*
* @param showErrorDetail
* @type boolean
* @text エラー詳細表示
* @desc ONにするとエラー時にエラーを発生させたイベントの情報とスタックトレースを表示します
* @default true
*
* @param enableProgressBar
* @type boolean
* @text ロード進捗バー有効化
* @desc ONにすると読み込みに時間がかかっている時にロード進捗バーを表示します
* @default true
*
* @param maxRenderingFps
* @type number
* @text 描画FPS上限値
* @desc 描画FPSの上限値を設定します (0を指定した場合は制限なし)
* @default 0
*/
(function() {
'use strict';
function isNumber(str) {
return !!str && !isNaN(str);
}
function toNumber(str, def) {
return isNumber(str) ? +str : def;
}
var parameters = PluginManager.parameters('Community_Basic');
var cacheLimit = toNumber(parameters['cacheLimit'], 10);
var screenWidth = toNumber(parameters['screenWidth'], 816);
var screenHeight = toNumber(parameters['screenHeight'], 624);
var renderingMode = parameters['renderingMode'].toLowerCase();
var alwaysDash = (parameters['alwaysDash'] === 'true') ||(parameters['alwaysDash'] === 'on');
var textSpeed = toNumber(parameters['textSpeed'], 1);
var windowWidthTo = toNumber(parameters['changeWindowWidthTo'], 0);
var windowHeightTo = toNumber(parameters['changeWindowHeightTo'], 0);
var maxRenderingFps = toNumber(parameters['maxRenderingFps'], 0);
var errorMessage = parameters['errorMessage'];
var showErrorDetail = parameters['showErrorDetail'] === 'true';
var enableProgressBar = parameters['enableProgressBar'] === 'true';
var windowWidth;
var windowHeight;
if(windowWidthTo){
windowWidth = windowWidthTo;
}else if(screenWidth !== SceneManager._screenWidth){
windowWidth = screenWidth;
}
if(windowHeightTo){
windowHeight = windowHeightTo;
}else if(screenHeight !== SceneManager._screenHeight){
windowHeight = screenHeight;
}
ImageCache.limit = cacheLimit * 1000 * 1000;
SceneManager._screenWidth = screenWidth;
SceneManager._screenHeight = screenHeight;
SceneManager._boxWidth = screenWidth;
SceneManager._boxHeight = screenHeight;
SceneManager.preferableRendererType = function() {
if (Utils.isOptionValid('canvas')) {
return 'canvas';
} else if (Utils.isOptionValid('webgl')) {
return 'webgl';
} else if (renderingMode === 'canvas') {
return 'canvas';
} else if (renderingMode === 'webgl') {
return 'webgl';
} else {
return 'auto';
}
};
var _ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
_ConfigManager_applyData.apply(this, arguments);
if (config['alwaysDash'] === undefined) {
this.alwaysDash = alwaysDash;
}
};
var _Window_Message_clearFlags = Window_Message.prototype.clearFlags;
Window_Message.prototype.clearFlags = function(textState) {
_Window_Message_clearFlags.apply(this, arguments);
this._textSpeed = textSpeed - 1;
};
var _SceneManager_initNwjs = SceneManager.initNwjs;
SceneManager.initNwjs = function() {
_SceneManager_initNwjs.apply(this, arguments);
if (Utils.isNwjs() && windowWidth && windowHeight) {
var dw = windowWidth - window.innerWidth;
var dh = windowHeight - window.innerHeight;
window.moveBy(-dw / 2, -dh / 2);
window.resizeBy(dw, dh);
}
};
if (maxRenderingFps) {
var currentTime = Date.now();
var deltaTime = 1000 / maxRenderingFps;
var accumulator = 0;
var _SceneManager_renderScene = SceneManager.renderScene;
SceneManager.renderScene = function() {
var newTime = Date.now();
accumulator += newTime - currentTime;
currentTime = newTime;
if (accumulator >= deltaTime) {
accumulator -= deltaTime;
_SceneManager_renderScene.apply(this, arguments);
}
};
}
// Graphics.setProgressEnabled(enableProgressBar);
})();

View file

@ -0,0 +1,376 @@
// by VienDesu! Poring Team 2023
// ============================================================
// Add Cordova pause/resume events support for AudioManager
// ============================================================
var currentBgm = null;
var currentBgs = null;
document.addEventListener("deviceready", onCordovaDeviceReady, false);
function onCordovaDeviceReady() {
console.log("AudioManager - SETUP!!!"); //Remove in release
document.addEventListener("pause", onCordovaPause, false);
document.addEventListener("resume", onCordovaResume, false);
};
function onCordovaPause() {
console.log("AudioManager - HIDE!!!"); //Remove in release
currentBgm = AudioManager.saveBgm();
currentBgs = AudioManager.saveBgs();
AudioManager.stopAll();
};
function onCordovaResume() {
console.log("AudioManager - SHOW!!!"); //Remove in release
AudioManager.replayBgm(currentBgm);
AudioManager.replayBgs(currentBgs);
};
// =========================================================
// Add Cordova pause/resume events support for RPG Maker
// =========================================================
WebAudio.prototype._setupEventHandlers = function () {
var resumeHandler = function () {
var context = WebAudio._context;
if (context && context.state === "suspended" && typeof context.resume === "function") {
context.resume().then(function () {
WebAudio._onTouchStart();
});
} else {
WebAudio._onTouchStart();
}
};
document.addEventListener("keydown", resumeHandler);
document.addEventListener("mousedown", resumeHandler);
document.addEventListener("touchend", resumeHandler);
document.addEventListener('touchstart', this._onTouchStart.bind(this));
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
document.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
};
WebAudio.prototype._onCordovaDeviceReady = function () {
console.log("WebAudio - SETUP!!!"); //Remove in release
document.addEventListener("pause", this._onCordovaPause.bind(this), false);
document.addEventListener("resume", this._onCordovaResume.bind(this), false);
};
WebAudio.prototype._onCordovaPause = function () {
console.log("WebAudio - HIDE!!!"); //Remove in release
this._onHide();
};
WebAudio.prototype._onCordovaResume = function () {
console.log("WebAudio - SHOW!!!"); //Remove in release
this._onShow();
};
Html5Audio.prototype._setupEventHandlers = function () {
document.addEventListener('touchstart', this._onTouchStart.bind(this));
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
this._audioElement.addEventListener("loadeddata", this._onLoadedData.bind(this));
this._audioElement.addEventListener("error", this._onError.bind(this));
this._audioElement.addEventListener("ended", this._onEnded.bind(this));
this._audioElement.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
};
Html5Audio.prototype._onCordovaDeviceReady = function () {
console.log("Html5Audio - SETUP!!!"); //Remove in release
this._audioElement.addEventListener("pause", this._onCordovaPause.bind(this), false);
this._audioElement.addEventListener("resume", this._onCordovaResume.bind(this), false);
};
Html5Audio.prototype._onCordovaPause = function () {
console.log("Html5Audio - HIDE!!!"); //Remove in release
this._onHide();
};
Html5Audio.prototype._onCordovaResume = function () {
console.log("Html5Audio - SHOW!!!"); //Remove in release
this._onShow();
};
// =====================================================================
// Add Cordova pause/resume events support for AudioStreaming plugin
// =====================================================================
StreamWebAudio.prototype._setupEventHandlers = function() {
var resumeHandler = function() {
var context = StreamWebAudio._context;
if (context && context.state === "suspended" && typeof context.resume === "function") {
context.resume().then(function() {
StreamWebAudio._onTouchStart();
})
} else {
StreamWebAudio._onTouchStart();
}
};
document.addEventListener("keydown", resumeHandler);
document.addEventListener("mousedown", resumeHandler);
document.addEventListener("touchend", resumeHandler);
document.addEventListener('touchstart', this._onTouchStart.bind(this));
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
document.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
};
StreamWebAudio.prototype._onCordovaDeviceReady = function () {
console.log("StreamWebAudio - SETUP!!!"); //Remove in release
document.addEventListener("pause", this._onCordovaPause.bind(this), false);
document.addEventListener("resume", this._onCordovaResume.bind(this), false);
};
StreamWebAudio.prototype._onCordovaPause = function () {
console.log("StreamWebAudio - HIDE!!!"); //Remove in release
this._onHide();
};
StreamWebAudio.prototype._onCordovaResume = function () {
console.log("StreamWebAudio - SHOW!!!"); //Remove in release
this._onShow();
};
// ============================
// Clear back button action
// ============================
document.addEventListener("backbutton", function(event){
event.preventDefault();
});
// =====================
// Scale game canvas
// =====================
document.addEventListener("deviceready", () => {
Graphics._centerElement = function (element) {
console.log("Element centered!!!");
var width = 640 * (window.screen.height / 480);
var height = window.screen.height;
element.style.position = 'absolute';
element.style.margin = 'auto';
element.style.top = 0;
element.style.left = 0;
element.style.right = 0;
element.style.bottom = 0;
element.style.width = width + 'px';
element.style.height = height + 'px';
};
})
// ===========================
// Gamepad tips on default
// ===========================
ConfigManager.gamepadTips = true;
ConfigManager.applyData = function (config) {
_TDS_.OmoriBASE.ConfigManager_applyData.call(this, config);
var initCheckList = ['characterStrafe', 'battleAnimations',
'battleAnimationSpeed', 'battleLogSpeed', 'screenResolution',
'fullScreen', 'menuAnimations']
for (var i = 0; i < initCheckList.length; i++) {
var name = initCheckList[i];
if (config[name] === undefined) { config[name] = this[name]; };
};
Yanfly.Param.ScreenWidth = 640 * (config.screenResolution + 1);
Yanfly.Param.ScreenHeight = 480 * (config.screenResolution + 1);
SceneManager._screenWidth = Yanfly.Param.ScreenWidth;
SceneManager._screenHeight = Yanfly.Param.ScreenHeight;
this.characterTurning = config.characterTurning;
this.characterStrafe = config.characterStrafe;
this.battleAnimations = config.battleAnimations;
this.battleAnimationSpeed = config.battleAnimationSpeed;
this.battleLogSpeed = config.battleLogSpeed === undefined ? 1 : config.battleLogSpeed;
this.screenResolution = config.screenResolution;
this.fullScreen = config.fullScreen;
this.menuAnimations = config.menuAnimations;
this.gamepadTips = config.gamepadTips || true;
this.textSkip = config.textSkip || false;
Input.keyMapper = config.keyboardInputMap;
Input.gamepadMapper = config.gamepadInputMap;
if (Input.keyMapper === undefined) { this.setDefaultKeyboardKeyMap(); };
if (Input.gamepadMapper === undefined) { this.setDefaultGamepadKeyMap(); };
Yanfly.updateResolution();
Yanfly.moveToCenter();
if ($gameSwitches) {
if (_TDS_.CharacterPressTurn_Strafing) {
$gameSwitches.setValue(_TDS_.CharacterPressTurn_Strafing.params.strafingDisableSwitchID, this.characterStrafe);
$gameSwitches.setValue(_TDS_.CharacterPressTurn_Strafing.params.pressDisableSwitchID, this.characterTurning)
};
};
};
ConfigManager.restoreDefaultConfig = function () {
const fs = require("fs");
const path = require('path');
var base = path.dirname(process.mainModule.filename);
base = path.join(base, 'save/');
if (fs.existsSync(base + "config.rpgsave")) { fs.unlinkSync(base + "config.rpgsave"); }
ConfigManager.characterStrafe = true;
ConfigManager.characterTurning = true;
ConfigManager.battleAnimations = true;
ConfigManager.battleAnimationSpeed = 0;
ConfigManager.battleLogSpeed = 1;
ConfigManager.screenResolution = 0;
ConfigManager.fullScreen = false;
ConfigManager.menuAnimations = true;
ConfigManager.gamepadTips = true;
ConfigManager.alwaysDash = false;
ConfigManager.textSkip = false;
this.setDefaultKeyboardKeyMap();
this.setDefaultGamepadKeyMap();
AudioManager._bgmVolume = 70;
AudioManager._bgsVolume = 90;
AudioManager._meVolume = 90;
AudioManager._seVolume = 90;
ConfigManager.bgmVolume = 70
ConfigManager.bgsVolume = 90
ConfigManager.meVolume = 90
ConfigManager.seVolume = 90
ConfigManager.applyData(ConfigManager);
let needsRestore = confirm(LanguageManager.languageData().text.System.plugins.optionsMenu.alertMessages["restoreGeneral"]);
if (!!needsRestore) { DataManager._restoreGlobalInfo(); }
}
Window_OmoMenuOptionsGeneral.prototype.processOptionCommand = function() {
var index = this.index();
var data = this._optionsList[index];
switch (index) {
case 0: // Screen Resolution
Yanfly.Param.ScreenWidth = 640 * (data.index + 1);
Yanfly.Param.ScreenHeight = 480 * (data.index + 1) ;
SceneManager._screenWidth = Yanfly.Param.ScreenWidth;
SceneManager._screenHeight = Yanfly.Param.ScreenHeight;
Yanfly.updateResolution();
Yanfly.moveToCenter();
// Set Config Manager Screen Resolution
ConfigManager.screenResolution = data.index;
break;
case 1:
ConfigManager.gamepadTips = data.index === 0 ? false : true;
if(SceneManager._scene instanceof Scene_OmoriTitleScreen) {
SceneManager._scene.refreshCommandHints(); // Refresh command title hints;
}
break;
case 2: ConfigManager.textSkip = data.index === 0 ? true : false; break;
case 3: ConfigManager.battleLogSpeed = data.index; ;break;
case 4: ConfigManager.alwaysDash = data.index === 0 ? true : false ;break;
// OMORI RUS mod specific:
case 5: ConfigManager.rusCoverInBadEnding = data.index === 0 ? true : false; break;
};
};
// ===================
// Android Wake Lock
// ===================
document.addEventListener("deviceready", () => {
window.plugins.insomnia.keepAwake();
})
// =============================
// Saves in external storage
// =============================
window._SAYGEXES = {};
function setSayGexValue(key, f, fallback) {
let saygex = window._SAYGEXES[key];
if (saygex != undefined) {
return f(saygex);
} else {
window._SAYGEXES[key] = fallback;
}
}
function getSaveName(path) {
return require.libs.path._solve_dots(path).split("/")[1];
}
function getAndroidSavePath(path) {
return cordova.file.externalDataDirectory + "save/" + getSaveName(path);
}
document.addEventListener("deviceready", () => {
StorageManager.isLocalMode = function () {
return true;
};
NativeFunctions.saveFileExists = function(path) {
if (window._SAYGEXES[path] != undefined) {
return window._SAYGEXES[path].exists;
}
let xhr = new XMLHttpRequest();
xhr.open("GET", getAndroidSavePath(path), false);
try {
xhr.send();
} catch (e) {
setSayGexValue(path, (v) => { v.exists = false; }, {exists: false, content: null});
return false;
}
setSayGexValue(path, (v) => { v.exists = true; }, {exists: true, content: null});
return xhr.status === 200 || xhr.status === 0;
}
NativeFunctions.readSaveFileUTF8 = function(path) {
let gex = window._SAYGEXES[path];
if (gex != undefined) {
if (gex.content != null) {
return gex.content;
}
}
let xhr = new XMLHttpRequest();
xhr.open("GET", getAndroidSavePath(path), false);
xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0");
xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
xhr.setRequestHeader("Pragma", "no-cache");
try {
xhr.send();
} catch (e) {
if (e.message.startsWith("Failed to execute 'send'")) {
alert(`Server returned status code 404 (${getAndroidSavePath(path)})`);
} else {
alert(e);
}
}
if (xhr.status !== 200 && xhr.status !== 0) {
alert(`Server returned status code ${xhr.status}`);
}
let text = xhr.responseText;
setSayGexValue(path, (v) => { v.content = text; }, {exists: true, content: text});
return text;
}
NativeFunctions.writeSaveFileUTF8 = function(path, data) {
setSayGexValue(path, (v) => { v.exists = true; v.content = data; }, {exists: true, content: data});
var split_path = require.libs.path._solve_dots(path).split("/");
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function (dirEntry) {
console.log(`Writing ${path} save file to the externalStorage`);
dirEntry.getDirectory(split_path[0], { create: true }, function (subDirEntry) {
subDirEntry.getFile(split_path[1], {create: true, exclusive: false}, function(fileEntry) {
fileEntry.createWriter(function (fileWriter) {
fileWriter.onerror = function (e) {
console.log("Failed file write: " + e.toString());
};
fileWriter.write(data);
});
}, (e) => {
console.log("Error to create external save file: " + e.toString());
});
});
});
}
})

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,358 @@
//=============================================================================
// TDS Custom Picture Controls
// Version: 1.2
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_CustomPictureControls = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.CustomPictureControls = _TDS_.CustomPictureControls || {};
//=============================================================================
/*:
* @plugindesc
* This plugin add custom controls as well as pictures for effects.
*
* @author TDS
*
*/
//=============================================================================
//=============================================================================
// ** Game_Interpreter
//-----------------------------------------------------------------------------
// The interpreter for running event commands.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
//=============================================================================
// * Update Wait mode
//=============================================================================
Game_Interpreter.prototype.updateWaitMode = function() {
// If Wait for picture animation
if (this._waitMode === 'pictureAnimation') {
// Get Picture
var picture = $gameScreen.picture(this._lastAnimatingPicture);
// If Picture exists and has a finite animation
if (picture && picture.hasAnimation(true)) { return true; }
// Set Last animating Picture to null
this._lastAnimatingPicture = null;
};
// Return Original Function
return _TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode.call(this);
};
//=============================================================================
// * Get Picture Sprite
//=============================================================================
Game_Interpreter.prototype.getPictureSprite = function(pictureId) {
return SceneManager._scene._spriteset._pictureContainer.children[pictureId]
};
//=============================================================================
// * Remove Picture Custom Frames
//=============================================================================
Game_Interpreter.prototype.removePictureCustomFrames = function(pictureId) {
// Get Picture
try {
var picture = $gameScreen.picture(pictureId);
// If Picture Exists
if (picture) {
// Clear Picture Custom Frame
picture.clearCustomFrame();
// Reset Picture Frame
this.getPictureSprite.resetFrame()
};
} catch(e) {}
};
//=============================================================================
// * Setup Picture Custom Frames
//=============================================================================
Game_Interpreter.prototype.setupPictureCustomFrames = function(pictureId, width, height, hFrames, vFrames) {
// Get Vertical & Horizontal Sizes
var fWidth = width / hFrames;
var fHeight = height / vFrames;
// Get Total Frames
var totalFrames = hFrames * vFrames;
// Initialize Rects Array
var rects = []
// Go Through Total frames
for (var i = 0; i < totalFrames; i++) { rects.push(new Rectangle((i % hFrames) * fWidth, Math.floor(i / hFrames) * fHeight, fWidth, fHeight)); };
// Setup Picture Frames
$gameScreen.picture(pictureId).setupCustomFrame(rects);
};
//=============================================================================
// * Set Picture Frame Index
//=============================================================================
Game_Interpreter.prototype.setPictureFrameIndex = function(pictureId, index) {
// Get Picture
var picture = $gameScreen.picture(pictureId)
// Set frame Index
picture.setCustomFrameIndex(index)
// Update Custom Frame
this.getPictureSprite(pictureId).updateCustomFrame();
};
//=============================================================================
// * Set Picture Animation
//=============================================================================
Game_Interpreter.prototype.setPictureAnimation = function(pictureId, frames, delay, loops = Infinity, wait = true) {
// Get Picture
var picture = $gameScreen.picture(pictureId);
// If Picture exists
if (picture) {
// Create animation
var animation = {frames: [], loops: loops, index: 0}
// Go Through Frames
for (var i = 0; i < frames.length; i++) {
// Get Frame
var frame = frames[i];
// If frame is an array
if (Array.isArray(frame)) {
// Add Frame to Animation
animation.frames.push({frame: frame[0], delay: frame[1], maxDelay: frame[1]})
} else {
// Add Frame to Animation
animation.frames.push({frame: frame, delay: delay, maxDelay: delay})
};
};
// Set Custom Frame animation
picture.setCustomFrameAnimation(animation);
// Update Custom Frame
this.getPictureSprite(pictureId).updateCustomFrame();
// If Wait and Loops is not infinite
if (wait && loops !== Infinity) {
// Set Wait mode
this.setWaitMode('pictureAnimation')
// Set Last Animating Picture
this._lastAnimatingPicture = pictureId;
};
};
};
//=============================================================================
// ** Game_Picture
//-----------------------------------------------------------------------------
// The game object class for a picture.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Game_Picture_initBasic = Game_Picture.prototype.initBasic;
_TDS_.CustomPictureControls.Game_Picture_update = Game_Picture.prototype.update;
//=============================================================================
// * Initialize Basic
//=============================================================================
Game_Picture.prototype.initBasic = function() {
// Run Original Function
_TDS_.CustomPictureControls.Game_Picture_initBasic.call(this);
// Initialize Frame Data
this.clearCustomFrame()
};
//=============================================================================
// * Determine if Picture has animation
//=============================================================================
Game_Picture.prototype.hasAnimation = function(finite = false) {
// Get Data
var data = this._frameData;
// If Frame data exists
if (data && data.animation !== null) {
// Return false if the animation is infinite
if (finite && !data.animation.loops !== Infinity) { return true; };
// Return true
return true;
};
// Return false by default
return false;
};
//=============================================================================
// * Clear Custom Frame
//=============================================================================
Game_Picture.prototype.clearCustomFrame = function() { this._frameData = null; };
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.setupCustomFrame = function(frames) {
// Initialize Frame Data
this._frameData = {frames: frames, frameIndex: 0, animation: null, refreshFrame: true}
};
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.setCustomFrameAnimation = function(animation) {
// Get Data
var data = this._frameData;
// If Frame data exists
if (data) {
// Set Frame Data Animation
data.animation = animation;
// Set Custom Frame Index
this.setCustomFrameIndex(animation.frames[animation.index].frame);
};
};
//=============================================================================
// * Get Custom Frame
//=============================================================================
Game_Picture.prototype.removeCustomFrameAnimation = function() {
// If Frame data exists
if (this._frameData) { this._frameData.animation = null; };
}
//=============================================================================
// * Set Custom Frame Index
//=============================================================================
Game_Picture.prototype.setCustomFrameIndex = function(index) {
// If Frame data exists
if (this._frameData) {
// Set Frame index
this._frameData.frameIndex = index;
// Set Refresh frame flag
this._frameData.refreshFrame = true;
};
}
//=============================================================================
// * Determine if Frame needs refreshing
//=============================================================================
Game_Picture.prototype.needsFrameRefresh = function() {
if (this._frameData) { return this._frameData.refreshFrame }
return false;
};
//=============================================================================
// * Get Custom Frame
//=============================================================================
Game_Picture.prototype.customFrame = function() {
return this._frameData.frames[this._frameData.frameIndex]
}
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.update = function() {
// Run Original Function
_TDS_.CustomPictureControls.Game_Picture_update.call(this);
// Update Frame Animation
this.updateFrameAnimation();
};
//=============================================================================
// * Frame Frame Animation
//=============================================================================
Game_Picture.prototype.updateFrameAnimation = function() {
// Get Data
var data = this._frameData;
// If Data and Animation Data exists
if (data && data.animation) {
// Get Animation
var anim = data.animation;
// Get Animation Frame
var frameAnim = anim.frames[anim.index];
// If Frame Animation Delay is 0 or less
if (frameAnim.delay <= 0) {
// Reset Frame Animation Max Delay
frameAnim.delay = frameAnim.maxDelay;
// Get MAx Frames
var maxFrames = anim.frames.length;
// If Animation has reached the end
if (anim.index >= maxFrames-1) {
// If Animation loops is more than 0
if (anim.loops > 0) {
// Decrease Animation loop count
anim.loops--
// Increase Index
anim.index = (anim.index + 1) % maxFrames;
} else {
// Remove Custom Frame Animation
this.removeCustomFrameAnimation()
};
} else {
// Increase Index
anim.index = (anim.index + 1) % maxFrames;
};
// Set Custom Frame Index
this.setCustomFrameIndex(anim.frames[anim.index].frame)
} else {
// Decrease Frame Animation Delay
frameAnim.delay--;
};
};
};
//=============================================================================
// ** Sprite_Picture
//-----------------------------------------------------------------------------
// The sprite for displaying a picture.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
_TDS_.CustomPictureControls.Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap = Sprite_Picture.prototype.updateBitmap
//=============================================================================
// * Object Initialization
//=============================================================================
Sprite_Picture.prototype.initialize = function(pictureId) {
// Get Picture Object
let picture = $gameScreen.picture(pictureId);
// If picture exists and it has frame data
if (picture && picture._frameData) {
// Set Refresh frame flag to true
picture._frameData.refreshFrame = true;
};
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_initialize.call(this, pictureId);
};
//=============================================================================
// * Update Bitmap
//=============================================================================
Sprite_Picture.prototype.updateBitmap = function() {
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap.call(this);
// Get Picture Object
var picture = this.picture();
// If Picture Exists
if (picture) {
// If Picture has frame data
if (picture._frameData) {
// Update Custom Frame
this.updateCustomFrame();
} else {
// Reset Frame
this.resetFrame()
};
};
};
//=============================================================================
// * Object Initialize
//=============================================================================
Sprite_Picture.prototype.updateOther = function() {
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_updateOther.call(this);
// Update Custom Frame
this.updateCustomFrame();
};
//=============================================================================
// * Update Custom Frame
//=============================================================================
Sprite_Picture.prototype.updateCustomFrame = function() {
// Get Picture Data
var picture = this.picture();
// If Picture Frame needs Refresh
if (picture && picture.needsFrameRefresh()) {
// Get Custom Frame
var rect = picture.customFrame();
// Set Frame
this.setFrame(rect.x, rect.y, rect.width, rect.height);
// Set Refresh Flag to false
picture._frameData.refreshFrame = false;
};
};
//=============================================================================
// * Reset Frame
//=============================================================================
Sprite_Picture.prototype.resetFrame = function() {
// If Bitmap Exist
if (this.bitmap) {
// Set Frame
this.setFrame(0, 0, this.bitmap.width, this.bitmap.height);
} else {
// Clear Frame
this.setFrame(0, 0, 0, 0);
}
};

View file

@ -0,0 +1,154 @@
//=============================================================================
// TDS Custom Character Rectangles
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {};
Imported.TDS_CustomCharacterRectangles = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {};
_TDS_.CustomCharacterRectangles = _TDS_.CustomCharacterRectangles || {};
//=============================================================================
/*:
* @plugindesc
* Description
*
* @author TDS
*
* Set Movement RoutePlayer (Wait)
* Scriptthis.setCustomFrameXY(6, 1)
* Wait5 frames
* Scriptthis.setCustomFrameXY(7, 1)
* Wait5 frames
* Scriptthis.setCustomFrameXY(8, 1)
* Wait5 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);
};

View file

@ -0,0 +1,366 @@
//=============================================================================
// TDS Custom Picture Controls
// Version: 1.2
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_CustomPictureControls = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.CustomPictureControls = _TDS_.CustomPictureControls || {};
//=============================================================================
/*:
* @plugindesc
* This plugin add custom controls as well as pictures for effects.
*
* @author TDS
*
*/
//=============================================================================
//=============================================================================
// ** Game_Interpreter
//-----------------------------------------------------------------------------
// The interpreter for running event commands.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
//=============================================================================
// * Update Wait mode
//=============================================================================
Game_Interpreter.prototype.updateWaitMode = function() {
// If Wait for picture animation
if (this._waitMode === 'pictureAnimation') {
// Get Picture
var picture = $gameScreen.picture(this._lastAnimatingPicture);
// If Picture exists and has a finite animation
if (picture && picture.hasAnimation(true)) { return true; }
// Set Last animating Picture to null
this._lastAnimatingPicture = null;
};
// Return Original Function
return _TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode.call(this);
};
//=============================================================================
// * Get Picture Sprite
//=============================================================================
Game_Interpreter.prototype.getPictureSprite = function(pictureId) {
return SceneManager._scene._spriteset._pictureContainer.children[pictureId]
};
//=============================================================================
// * Remove Picture Custom Frames
//=============================================================================
Game_Interpreter.prototype.removePictureCustomFrames = function(pictureId) {
// Get Picture
var picture = $gameScreen.picture(pictureId);
// If Picture Exists
if (picture) {
// Clear Picture Custom Frame
picture.clearCustomFrame();
// Reset Picture Frame
this.getPictureSprite.resetFrame()
};
};
//=============================================================================
// * Setup Picture Custom Frames
//=============================================================================
Game_Interpreter.prototype.setupPictureCustomFrames = function(pictureId, width, height, hFrames, vFrames) {
// Get Vertical & Horizontal Sizes
var fWidth = width / hFrames;
var fHeight = height / vFrames;
// Get Total Frames
var totalFrames = hFrames * vFrames;
// Initialize Rects Array
var rects = []
// Go Through Total frames
for (var i = 0; i < totalFrames; i++) { rects.push(new Rectangle((i % hFrames) * fWidth, Math.floor(i / hFrames) * fHeight, fWidth, fHeight)); };
// Setup Picture Frames
$gameScreen.picture(pictureId).setupCustomFrame(rects);
};
//=============================================================================
// * Set Picture Frame Index
//=============================================================================
Game_Interpreter.prototype.setPictureFrameIndex = function(pictureId, index) {
// Get Picture
var picture = $gameScreen.picture(pictureId)
// Set frame Index
picture.setCustomFrameIndex(index)
// Update Custom Frame
this.getPictureSprite(pictureId).updateCustomFrame();
};
//=============================================================================
// * Set Picture Animation
//=============================================================================
Game_Interpreter.prototype.setPictureAnimation = function(pictureId, frames, delay, loops = Infinity, wait = true) {
// Get Picture
var picture = $gameScreen.picture(pictureId);
// If Picture exists
if (picture) {
// Create animation
var animation = {frames: [], loops: loops, index: 0}
// Go Through Frames
for (var i = 0; i < frames.length; i++) {
// Get Frame
var frame = frames[i];
// If frame is an array
if (Array.isArray(frame)) {
// Add Frame to Animation
animation.frames.push({frame: frame[0], delay: frame[1], maxDelay: frame[1]})
} else {
// Add Frame to Animation
animation.frames.push({frame: frame, delay: delay, maxDelay: delay})
};
};
// Set Custom Frame animation
picture.setCustomFrameAnimation(animation);
// Update Custom Frame
this.getPictureSprite(pictureId).updateCustomFrame();
// If Wait and Loops is not infinite
if (wait && loops !== Infinity) {
// Set Wait mode
this.setWaitMode('pictureAnimation')
// Set Last Animating Picture
this._lastAnimatingPicture = pictureId;
};
};
};
//=============================================================================
// ** Game_Picture
//-----------------------------------------------------------------------------
// The game object class for a picture.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Game_Picture_initBasic = Game_Picture.prototype.initBasic;
_TDS_.CustomPictureControls.Game_Picture_update = Game_Picture.prototype.update;
//=============================================================================
// * Initialize Basic
//=============================================================================
Game_Picture.prototype.initBasic = function() {
// Run Original Function
_TDS_.CustomPictureControls.Game_Picture_initBasic.call(this);
// Initialize Frame Data
this.clearCustomFrame()
};
//=============================================================================
// * Determine if Picture has animation
//=============================================================================
Game_Picture.prototype.hasAnimation = function(finite = false) {
// Get Data
var data = this._frameData;
// If Frame data exists
if (data && data.animation !== null) {
// Return false if the animation is infinite
if (finite && !data.animation.loops !== Infinity) { return true; };
// Return true
return true;
};
// Return false by default
return false;
};
//=============================================================================
// * Clear Custom Frame
//=============================================================================
Game_Picture.prototype.clearCustomFrame = function() { this._frameData = null; };
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.setupCustomFrame = function(frames) {
// Initialize Frame Data
this._frameData = {frames: frames, frameIndex: 0, animation: null, refreshFrame: true}
};
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.setCustomFrameAnimation = function(animation) {
// Get Data
var data = this._frameData;
// If Frame data exists
if (data) {
// Set Frame Data Animation
data.animation = animation;
// Set Custom Frame Index
this.setCustomFrameIndex(animation.frames[animation.index].frame);
};
};
//=============================================================================
// * Get Custom Frame
//=============================================================================
Game_Picture.prototype.removeCustomFrameAnimation = function() {
// If Frame data exists
if (this._frameData) { this._frameData.animation = null; };
}
//=============================================================================
// * Set Custom Frame Index
//=============================================================================
Game_Picture.prototype.setCustomFrameIndex = function(index) {
// If Frame data exists
if (this._frameData) {
// Set Frame index
this._frameData.frameIndex = index;
// Set Refresh frame flag
this._frameData.refreshFrame = true;
};
}
//=============================================================================
// * Determine if Frame needs refreshing
//=============================================================================
Game_Picture.prototype.needsFrameRefresh = function() {
if (this._frameData) { return this._frameData.refreshFrame }
return false;
};
//=============================================================================
// * Get Custom Frame
//=============================================================================
Game_Picture.prototype.customFrame = function() {
return this._frameData.frames[this._frameData.frameIndex]
}
//=============================================================================
// * Frame Update
//=============================================================================
Game_Picture.prototype.update = function() {
// Run Original Function
_TDS_.CustomPictureControls.Game_Picture_update.call(this);
// Update Frame Animation
this.updateFrameAnimation();
};
//=============================================================================
// * Frame Frame Animation
//=============================================================================
Game_Picture.prototype.updateFrameAnimation = function() {
// Get Data
var data = this._frameData;
// If Data and Animation Data exists
if (data && data.animation) {
// Get Animation
var anim = data.animation;
// Get Animation Frame
var frameAnim = anim.frames[anim.index];
// If Frame Animation Delay is 0 or less
if (frameAnim.delay <= 0) {
// Reset Frame Animation Max Delay
frameAnim.delay = frameAnim.maxDelay;
// Get MAx Frames
var maxFrames = anim.frames.length;
// If Animation has reached the end
if (anim.index >= maxFrames-1) {
// If Animation loops is more than 0
if (anim.loops > 0) {
// Decrease Animation loop count
anim.loops--
// Increase Index
anim.index = (anim.index + 1) % maxFrames;
} else {
// Remove Custom Frame Animation
this.removeCustomFrameAnimation()
};
} else {
// Increase Index
anim.index = (anim.index + 1) % maxFrames;
};
// Set Custom Frame Index
this.setCustomFrameIndex(anim.frames[anim.index].frame)
} else {
// Decrease Frame Animation Delay
frameAnim.delay--;
};
};
};
//=============================================================================
// ** Sprite_Picture
//-----------------------------------------------------------------------------
// The sprite for displaying a picture.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.CustomPictureControls.Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
_TDS_.CustomPictureControls.Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap = Sprite_Picture.prototype.updateBitmap
//=============================================================================
// * Object Initialization
//=============================================================================
Sprite_Picture.prototype.initialize = function(pictureId) {
// Get Picture Object
let picture = $gameScreen.picture(pictureId);
// If picture exists and it has frame data
if (picture && picture._frameData) {
// Set Refresh frame flag to true
picture._frameData.refreshFrame = true;
};
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_initialize.call(this, pictureId);
};
//=============================================================================
// * Update Bitmap
//=============================================================================
Sprite_Picture.prototype.updateBitmap = function() {
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap.call(this);
// Get Picture Object
var picture = this.picture();
// If Picture Exists
if (picture) {
// If Picture has frame data
if (picture._frameData) {
// Update Custom Frame
this.updateCustomFrame();
} else {
// Reset Frame
this.resetFrame()
};
};
};
//=============================================================================
// * Object Initialize
//=============================================================================
Sprite_Picture.prototype.updateOther = function() {
// Run Original Function
_TDS_.CustomPictureControls.Sprite_Picture_updateOther.call(this);
// Update Custom Frame
this.updateCustomFrame();
};
//=============================================================================
// * Update Custom Frame
//=============================================================================
Sprite_Picture.prototype.updateCustomFrame = function() {
// Get Picture Data
var picture = this.picture();
// If Picture Frame needs Refresh
if (picture && picture.needsFrameRefresh()) {
// Get Custom Frame
var rect = picture.customFrame();
// Set Frame
this.setFrame(rect.x, rect.y, rect.width, rect.height);
// Set Refresh Flag to false
picture._frameData.refreshFrame = false;
};
};
//=============================================================================
// * Reset Frame
//=============================================================================
Sprite_Picture.prototype.resetFrame = function() {
// If Bitmap Exist
if (this.bitmap) {
// Set Frame
this.setFrame(0, 0, this.bitmap.width, this.bitmap.height);
} else {
// Clear Frame
this.setFrame(0, 0, 0, 0);
}
};
//=============================================================================
// * Object Initialize
//=============================================================================
// Sprite_Picture.prototype.setFrame = function(x, y, width, height) {
// Sprite.prototype.setFrame.call(this, x, y, width, height)
// console.log(arguments.callee.caller.toString())
// console.log(x, y, width, height)
// }

View file

@ -0,0 +1,30 @@
//-----------------------------------------------------------------------------
// Galv's Disable Mouse
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// DisableMouse.js
//-----------------------------------------------------------------------------
// Version 1.0
// 2015-11-03 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_NoMouse = true;
//-----------------------------------------------------------------------------
/*:
* @plugindesc Disables mouse clicks.
*
* @author Galv - galvs-scripts.com
*
* @help
* This space intentionally left blank.
*
*/
TouchInput._onMouseDown = function(event) {
// Overwrite to do nothing
};

View file

@ -0,0 +1,665 @@
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// █▐▐ Follower Control
// ╞══════════════════════════════════════════════════════════════════════════════════╡
/*:
* @plugindesc Options to control and enhance interaction with followers.
* @author Exhydra
*
* @param Interpreter Commands
* @desc (Advanced Option) Comma delimited list of allowed
interpreter commands followers can use.
* @default 205,212,213
*
* @help
* Plugin
*
* Version : 1.2
* Release : 14th July 2016
* Updated : 24rd July 2016
* License : Free for Commercial and Non-Commercial Usage
*
* Plugin Commands
*
* exaFC.linkEvent boolean followerId eventId
*
* Link or unlink a follower to an event on the current map. The
* condition to start the follower event will match whatever is selected
* on the 'Trigger' drop-down menu within the linked event.
*
* boolean
* Value(s) true, false
*
* followerId
* Value(s) 0, 1, 2, (...)
* Note The 0th position is the 1st follower, and so on.
*
* eventId
* Value(s) Map Event ID
*
* exaFC.followerInstruct boolean followerId
*
* Enable or disable re-directing interpreter commands to a follower.
* Once enabled, you can set the Movement Route target to 'Player' and
* pass each command listed within to the selected follower. Should be
* used in conjunction with the 'exaFC.followerStop' plugin command.
*
* boolean
* Value(s) true, false
*
* followerId
* Value(s) 0, 1, 2, (...)
* Note The 0th position is the 1st follower, and so on. Value
* is only required to be included when enabling the
* command.
*
* exaFC.moveType type followerId moveSpeed moveFrequency
*
* Selects and/or changes the move type of a follower. Should be
* used in conjunction with the 'followerStop' and 'lockProperties'
* plugin command.
*
* type
* Value(s) fixed, random, approach, custom, clear
* Note When selecting the 'custom' type, place the Movement
* Route you wish the follower to copy directly beneath
* the plugin command. The 'clear' option will erase
* the current memorized move route.
*
* followerId
* Value(s) 0, 1, 2, (...)
* Note The 0th position is the 1st follower, and so on.
*
* moveSpeed
* Value(s) Integer
* Note Value is optional.
*
* moveFrequency
* Value(s) Integer
* Note Value is optional.
*
* exaFC.lockProperties boolean followerId
*
* Lock or unlock the properties of a follower. By default,
* followers will mirror the movement speed as well as various
* other properties of the party leader. This command will stop
* the selected follower from doing so.
*
* boolean
* Value(s) true, false
*
* followerId
* Value(s) 0, 1, 2, (...)
* Note The 0th position is the 1st follower, and so on.
*
* exaFC.followerStop boolean
*
* Enable or disable followers chasing the player.
*
* boolean
* Value(s) true, false
*
* exaFC.followerCollision boolean
*
* Enable or disable player collision with followers.
*
* boolean
* Value(s) true, false
*
* exaFC.clearAll
*
* Clears control properties from all followers.
*
*
*
* Examples
*
* exaFC.linkEvent true 1 15
* Link the 2nd follower to the event with an ID of 15.
*
* exaFC.linkEvent false 1
* Unlink the 2nd follower from the linked event.
*
* exaFC.followerInstruct true 2
* Re-direct interpreter commands to the 3rd follower.
*
* exaFC.followerInstruct false
* Disable interpreter command re-direct for all followers.
*
* exaFC.followerStop true
* Disable followers chasing the player.
*
* exaFC.followerCollision true
* Enables player collision with followers.
*
*/
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Plugin
// ╘══════════════════════════════════════════════════════════════════════════════════╛
var Imported = Imported || {};
Imported.EXA_SimpleFollowerControl = true;
var EXA = EXA || {};
EXA.FC = EXA.FC || {};
EXA.FC.pluginParams = PluginManager.parameters('Exhydra_FollowerControl');
EXA.FC.pluginParams.allowedList = EXA.FC.pluginParams['Interpreter Commands'] || '205,212,213';
EXA.FC.pluginParams.allowedList.split(',').map(Number);
EXA.FC.followerControl = false;
EXA.FC.followerControlId = -1;
EXA.FC.followerStop = false;
EXA.FC.followerCollision = false;
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Game_Interpreter
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] pluginCommand
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
EXA.FC.Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'exaFC.linkEvent') {
var follower = $gamePlayer._followers.follower(args[1]);
if (follower) {
if (args[0] === 'true') {
follower._fcEventId = Number(args[2]);
} else {
follower._fcEventId = -1;
}
}
}
if (command === 'exaFC.followerInstruct') {
if (args[0] === 'true') {
EXA.FC.followerControlId = Number(args[1]);
EXA.FC.followerControl = true;
} else {
EXA.FC.followerControlId = -1;
EXA.FC.followerControl = false;
}
}
if (command === 'exaFC.moveType') {
var follower = $gamePlayer._followers.follower(args[1]) || null;
if (follower) {
if (args[0] === 'fixed') {
follower._moveType = 0;
} else if (args[0] === 'random') {
follower._moveType = 1;
} else if (args[0] === 'approach') {
follower._moveType = 2;
} else if (args[0] === 'custom') {
if (this.nextEventCode() === 205) {
var moveRoute = this._list[this._index + 1].parameters[1];
follower.setMoveRoute(moveRoute);
follower._moveType = 3;
this._index = this._index + 2;
} else {
follower._moveType = 0;
}
} else if (args[0] === 'clear') {
follower._moveType = 0;
follower.setMoveRoute(null);
}
if (args[2]) {
follower._moveSpeed = Number(args[2]);
}
if (args[3]) {
follower._moveFrequency = Number(args[3]);
}
}
}
if (command === 'exaFC.lockProperties') {
var followerId = Number(args[1]);
var follower = $gamePlayer._followers.follower(followerId) || null;
if (follower) {
if (args[0] === 'true') {
follower._fcRetainAttrib = true;
} else {
follower._fcRetainAttrib = false;
}
}
}
if (command === 'exaFC.followerStop') {
EXA.FC.followerStop = (args[0] == 'true');
}
if (command === 'exaFC.followerCollision') {
var toggle = (args[0] == 'true')
EXA.FC.followerCollision = toggle;
$gamePlayer._followers.forEach(function (follower) {
follower.setThrough(!toggle);
});
}
if (command === 'exaFC.clearAll') {
EXA.FC.followerControlId = -1;
EXA.FC.followerControl = false;
EXA.FC.followerStop = false;
EXA.FC.followerCollision = false;
$gamePlayer._followers.forEach(function (follower) {
follower._fcEventId = -1;
follower._moveType = 0;
follower._fcEventLock = false;
follower._fcPrelockDirection = 0;
follower._fcRetainAttrib = false;
follower.setMoveRoute(null);
follower.setThrough(true);
follower.update();
});
}
}; // Game_Interpreter pluginCommand
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] character
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Interpreter_character = Game_Interpreter.prototype.character;
Game_Interpreter.prototype.character = function(param) {
if (isNaN(param)) {
var followerMatch = param.match(/fcF:(\d+)/);
if (followerMatch) {
var followerId = followerMatch[1];
return $gamePlayer._followers.follower(followerId);
}
}
return EXA.FC.Game_Interpreter_character.call(this, param);
}; // Game_Interpreter character
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] executeCommand
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Interpreter_executeCommand = Game_Interpreter.prototype.executeCommand;
Game_Interpreter.prototype.executeCommand = function() {
if (EXA.FC.followerControl) {
var command = this.currentCommand();
if (command) {
if (EXA.FC.pluginParams.allowedList.indexOf(command.code) != -1) {
if (command.parameters[0] < 0) {
command.parameters[0] = 'fcF:' + EXA.FC.followerControlId;
}
}
}
}
return EXA.FC.Game_Interpreter_executeCommand.call(this);
}; // Game_Interpreter executeCommand
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Game_Player
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// NEW ───────────────────────────────────────────────────────────────────────────────┐
// □ [Function] isCollidedWithCharacters
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Player.prototype.isCollidedWithCharacters = function(x, y) {
return this.isCollidedWithFollowers(x, y) ||
Game_CharacterBase.prototype.isCollidedWithCharacters.call(this, x, y);
}; // Game_Player isCollidedWithCharacters
// NEW ───────────────────────────────────────────────────────────────────────────────┐
// □ [Function] isCollidedWithFollowers
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Player.prototype.isCollidedWithFollowers = function(x, y) {
if (EXA.FC.followerCollision) {
return this._followers.isSomeoneCollided(x, y);
}
return false;
}; // Game_Player isCollidedWithFollowers
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] startMapEvent
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Player_startMapEvent = Game_Player.prototype.startMapEvent;
Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
if (!$gameMap.isEventRunning()) {
this._followers.forEach(function(follower, index) {
if (follower._fcEventId > -1) {
if (follower.pos(x, y)) {
event = $gameMap.event(follower._fcEventId);
if (event.isTriggerIn(triggers)) {
event._fcFollowerId = index;
event.start();
}
}
}
});
}
EXA.FC.Game_Player_startMapEvent.call(this, x, y, triggers, normal);
}; // Game_Player startMapEvent
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Game_Event
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] initMembers
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Event_initMembers = Game_Event.prototype.initMembers;
Game_Event.prototype.initMembers = function() {
EXA.FC.Game_Event_initMembers.call(this);
this._fcFollowerId = -1;
}; // Game_Event initMembers
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] lock
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Event_lock = Game_Event.prototype.lock;
Game_Event.prototype.lock = function() {
EXA.FC.Game_Event_lock.call(this);
if (this._fcFollowerId > -1) {
$gamePlayer._followers.follower(this._fcFollowerId).lock();
}
}; // Game_Event lock
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] unlock
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Event_unlock = Game_Event.prototype.unlock;
Game_Event.prototype.unlock = function() {
EXA.FC.Game_Event_unlock.call(this);
if (this._fcFollowerId > -1) {
$gamePlayer._followers.follower(this._fcFollowerId).unlock();
this._fcFollowerId = -1;
}
}; // Game_Event unlock
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Game_Follower
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] initialize
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Follower_initialize = Game_Follower.prototype.initialize;
Game_Follower.prototype.initialize = function(memberIndex) {
EXA.FC.Game_Follower_initialize.call(this, memberIndex);
this._fcEventId = -1;
this._fcEventLock = false;
this._fcPrelockDirection = 0;
this._fcRetainAttrib = false;
}; // Game_Follower initialize
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] update
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Follower_update = Game_Follower.prototype.update;
Game_Follower.prototype.update = function() {
if (this._fcRetainAttrib || EXA.FC.followerControl) {
Game_Character.prototype.update.call(this);
} else {
EXA.FC.Game_Follower_update.call(this);
}
}; // Game_Follower update
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] updateStop
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.updateStop = function() {
if (this._fcEventLock) {
this.resetStopCount();
}
Game_Character.prototype.updateStop.call(this);
if (!this.isMoveRouteForcing()) {
this.updateSelfMovement();
}
}; // Game_Follower updateStop
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] lock
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.lock = function() {
if (!this._fcEventLock) {
this._fcPrelockDirection = this.direction();
this.turnTowardPlayer();
this._fcEventLock = true;
}
}; // Game_Follower lock
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] unlock
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.unlock = function() {
if (this._fcEventLock) {
this._fcEventLock = false;
this.setDirection(this._fcPrelockDirection);
}
}; // Game_Follower unlock
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] updateSelfMovement
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.updateSelfMovement = function() {
if (this._moveType > 0) {
if (!this._fcEventLock && this.isNearTheScreen() &&
this.checkStop(this.stopCountThreshold())) {
switch (this._moveType) {
case 1:
this.moveTypeRandom();
break;
case 2:
this.moveTypeTowardPlayer();
break;
case 3:
this.moveTypeCustom();
break;
}
}
}
}; // Game_Follower updateSelfMovement
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] stopCountThreshold
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.stopCountThreshold = function() {
return 30 * (5 - this.moveFrequency());
}; // Game_Follower stopCountThreshold
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] moveTypeRandom
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.moveTypeRandom = function() {
switch (Math.randomInt(6)) {
case 0: case 1:
this.moveRandom();
break;
case 2: case 3: case 4:
this.moveForward();
break;
case 5:
this.resetStopCount();
break;
}
}; // Game_Follower moveTypeRandom
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] moveTypeTowardPlayer
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.moveTypeTowardPlayer = function() {
if (this.isNearThePlayer()) {
switch (Math.randomInt(6)) {
case 0: case 1: case 2: case 3:
this.moveTowardPlayer();
break;
case 4:
this.moveRandom();
break;
case 5:
this.moveForward();
break;
}
} else {
this.moveRandom();
}
}; // Game_Follower moveTypeTowardPlayer
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] moveTypeCustom
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.moveTypeCustom = function() {
this.updateRoutineMove();
}; // Game_Follower moveTypeCustom
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] isNearThePlayer
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.isNearThePlayer = function() {
var sx = Math.abs(this.deltaXFrom($gamePlayer.x));
var sy = Math.abs(this.deltaYFrom($gamePlayer.y));
return sx + sy < 20;
}; // Game_Follower isNearThePlayer
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] isCollidedWithCharacters
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.isCollidedWithCharacters = function(x, y) {
if (EXA.FC.followerCollision) {
return (Game_Character.prototype.isCollidedWithCharacters.call(this, x, y) ||
this.isCollidedWithPlayerCharacters(x, y));
} else {
return Game_Character.prototype.isCollidedWithCharacters.call(this, x, y);
}
}; // Game_Follower isCollidedWithCharacters
// NEW ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] isCollidedWithPlayerCharacters
// └──────────────────────────────────────────────────────────────────────────────────┘
Game_Follower.prototype.isCollidedWithPlayerCharacters = function(x, y) {
return this.isNormalPriority() && $gamePlayer.isCollided(x, y);
}; // Game_Follower isCollidedWithPlayerCharacters
// ╒══════════════════════════════════════════════════════════════════════════════════╕
// ■ [Object] Game_Followers
// ╘══════════════════════════════════════════════════════════════════════════════════╛
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] updateMove
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Followers_updateMove = Game_Followers.prototype.updateMove;
Game_Followers.prototype.updateMove = function() {
if (EXA.FC.followerStop) return;
EXA.FC.Game_Followers_updateMove.call(this);
}; // Game_Followers updateMove
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
// □ [Function] jumpAll
// └──────────────────────────────────────────────────────────────────────────────────┘
EXA.FC.Game_Followers_jumpAll = Game_Followers.prototype.jumpAll;
Game_Followers.prototype.jumpAll = function() {
if (EXA.FC.followerStop) return;
EXA.FC.Game_Followers_jumpAll.call(this);
}; // Game_Followers jumpAll
// ▌▌██████████████████████████████████████ EOF █████████████████████████████████████▐▐

View file

@ -0,0 +1,96 @@
"use strict";
//=============================================================================
// TDS External Notes
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {}; Imported.TDS_ExternalNotes = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {}; _TDS_.ExternalNotes = _TDS_.ExternalNotes || {};
//=============================================================================
/*:
* @plugindesc
* This script allows you to set notes for objects with an external file.
*
* @author TDS
*
* @help
* ============================================================================
* * Notes
* ============================================================================
*
* <LoadNotes: KEY, VALUE>
*
* KEY
* ^ Key name. (Used to divide different types of notes)
*
*
* VALUE
* ^ Value name. (Contains the contents of the notes)
*
*
* Example:
*
* <LoadNotes: Actors, test1>
*/
//=============================================================================
//=============================================================================
// ** DataManager
//-----------------------------------------------------------------------------
// The game object class for the party. Information such as gold and items is
// included.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ExternalNotes.DataManager_loadDatabase = DataManager.loadDatabase;
_TDS_.ExternalNotes.DataManager_extractMetadata = DataManager.extractMetadata;
//=============================================================================
// * Load Database
//=============================================================================
DataManager.loadDatabase = function () {
var path = require('path');
var fs = require('fs');
var yaml = require('./js/libs/js-yaml-master')
var base = path.dirname(process.mainModule.filename);
// If External Notes Data is undefined
if (window['$externalNotesData'] === undefined) {
// Get Atlas File
window['$externalNotesData'] = jsyaml.load(fs.readFileSync(base + '/data/Notes.yaml', 'utf8'));
};
// Run Original Function
_TDS_.ExternalNotes.DataManager_loadDatabase.call(this);
};
//=============================================================================
// * Extract Metadata
//=============================================================================
DataManager.extractMetadata = function (data) {
// If Data note is not empty
if (data.note.length > 0) {
// Get Regular Expression
var re = /<LoadNotes:(.+)>/gmi;
// Notes
var notes = '';
// Iterate
for (; ;) {
// Get Match
var match = re.exec(data.note);
// If Match
if (match) {
// Get Arguments
var args = RegExp.$1.split(',');
// Add Custom notes to notes
notes += $externalNotesData.NOTES[args[0].trim()][args[1].trim()] + '\n'
} else {
break;
};
};
// Add Custom notes to data notes
data.note += notes;
};
// Run Original Function
_TDS_.ExternalNotes.DataManager_extractMetadata.call(this, data);
};

View file

@ -0,0 +1,348 @@
//=============================================================================
// ExtraMovementFrames.js
//=============================================================================
// Version: 1.0.3
// Date: 10 November 2015
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*:
* @author Modern Algebra (rmrk.net)
* @plugindesc Set sprites with more than 3 frames of animation
*
* @param Cycle Time
* @desc The normal number of frames to complete animation cycle for custom sprites
* @default 60
*
* @param Default Idle Frame
* @desc The idle frame for custom sprites unless changed in the filename
* @default 0
*
* @param Default Pattern
* @desc Set patterns for custom sprites unless changed in the filename.
* @default []
*
* @help INSTRUCTIONS:
*
* To create sprites that have more than 3 frames of animation, you need
* to rename the character graphic to something of the form:
*
* RegularName%(x)
* x : the number of frames in each character sprite
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* EXAMPLES:
*
* $001-Fighter01%(4)
* // This graphic is a single character with four frames of animation.
*
* 022-Actors12%(6)
* // This graphic would be interpreted as a character sheet of 8
* // characters each having six frames of animation.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Additionally, this script also allows you to specify the "idle" frame (the
* frame where the sprite is not moving), and also the pattern if you wish to so
* specify. In essence, all you need to do is add those integers after the
* number of frames:
*
* Regular_Name%(x y z1 z2 ... zn)
* x : the number of frames in each character sprite
* y : the idle frame (the frame shown when sprite is not moving)
* z1 ... zn : the pattern.
*
* If you choose to specify a pattern, then the idle frame is not automatically
* included in the pattern and should be repeated if you want it to appear
*
* When naming your files, be aware that the first frame in a sprite is index 0,
* the second frame is index 1, etc.
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* EXAMPLES:
*
* $003-Fighter03%(4 2)
* // This graphic is a single character with four frames of animation.
* // The idle frame is 2 (the third one over). The pattern when moving
* // would be 2 3 0 1, 2 3 0 1, etc. (unless default patterns set -
* // see below)
*
* 032-People05%(4 0 1 0 3 2)
* // This graphic would be interpreted as a character sheet of 8
* // characters, each having four frames of animation. The idle frame is
* // 0 (the first in the sheet), and the pattern is 1 0 3 2,
* // 1 0 3 2, etc.
*
* $003-Fighter03%(6 0 1 2 3 4 5)
* // This graphic is a single character with six frames of animation.
* // The idle frame is 0 (the first frame). The pattern when moving
* // is 1 2 3 4 5, 1 2 3 4 5, etc.
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* PLUGIN SETTINGS:
*
* Cycle Time = 60
*
* Cycle Time is the number of frames it will take to complete a full
* animation cycle for custom sprites at normal speed. It must be set to an
* integer.
*
*
* Default Idle Frame = 0
*
* If you do not specify an idle frame for custom sprites in the file name, then it
* will be this frame. You must set this to an integer.
*
* Default Pattern = []
*
* If you do not specify a pattern, then what happens depends on what you write
* in the plugin setting for "Default Pattern". For this setting, you have the
* option of writing in arrays of numbers in the following format:
*
* [x y z1 z2 ... zn]
* x : number of frames in the sprites for which this pattern is default
* y : idle frame
* z1 z2 ... zn : the pattern
*
* If you have setup one of those arrays for the number of frames which this
* custom sprite has, then it will use that pattern and idle frame.
*
* If you have not set up a default pattern for this number of frames, then the
* animation will simply cycle through the number of frames, starting with the
* idle frame and moving right. The idle frame will be included in the animation.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* EXAMPLES
*
* Default Pattern = [5 1 2 3 4 3 2]
* // Whenever you set up a custom sprite that has 5 frames of animation
* // but do not specify a pattern, the idle frame will be 1 and the
* // pattern will be 2 3 4 3 2, 2 3 4 3 2, etc.
*
* Default Pattern = [5 1 2 3 4 3 2], [6 0 1 2 5 4 3 0]
* // Whenever you set up a custom sprite that has 5 frames of animation
* // but do not specify a pattern, the idle frame will be 1 and the
* // pattern will be 2 3 4 3 2, 2 3 4 3 2, etc.
* // Whenever you set up a custom sprite that has 6 frames of animation
* // but do not specify a pattern, the idle frame will be 0 and the
* // pattern will be 1 2 5 4 3 0, 1 2 5 4 3 0, etc.
*/
//=============================================================================
var Imported = Imported || {};
Imported.MA_ExtraMovementFrames = true;
var ModernAlgebra = ModernAlgebra || {};
ModernAlgebra.EMF = {};
(function() {
// Get Script Name, in case user unexpectedly altered it
//var path = document.currentScript.src;
//var scriptName = path.substring(path.lastIndexOf('/')+1).match(/^(.+?)(\.[^.]*$|$)/)[1];
// Set Parameters
ModernAlgebra.EMF.parameters = PluginManager.parameters("ExtraMovementFrames");
ModernAlgebra.EMF.cycleTime = (+ModernAlgebra.EMF.parameters['Cycle Time']) || 60; // Default = 60
ModernAlgebra.EMF.idleFrame = (+ModernAlgebra.EMF.parameters['Default Idle Frame']) || 0; // Default = 0
ModernAlgebra.EMF.defaultPattern = [];
var emfPattMatch = ModernAlgebra.EMF.parameters['Default Pattern'].match(/\[.+?\]/g); // Default []
if (emfPattMatch) {
// Get all arrays of numbers
for (var i = 0; i < emfPattMatch.length; i++) {
digitMatch = emfPattMatch[i].match(/\d+/g);
if (digitMatch) { ModernAlgebra.EMF.defaultPattern.push(digitMatch.map(Number)); }
}
}
//=========================================================================
// ImageManager
//=========================================================================
// isEmfCharacter - Checks if filename is a customly animated sprite
ImageManager.isEmfCharacter = function(filename) {
return !!filename.match(/\%[\(\[][\d\s]+[\)\]]/); // check filename for %() or %[]
};
//=========================================================================
// Game_CharacterBase
//=========================================================================
// initMembers
ModernAlgebra.EMF.GameCharacterBase_initMembers =
Game_CharacterBase.prototype.initMembers;
Game_CharacterBase.prototype.initMembers = function() {
this.maClearEmfCharacterState();
ModernAlgebra.EMF.GameCharacterBase_initMembers.apply(this, arguments); // original method
};
// maClearEmfCharacterState
Game_CharacterBase.prototype.maClearEmfCharacterState = function() {
this._isEmfCharacter = false;
this._emfCharacterState = { frameNum: 3, idleFrame: ModernAlgebra.EMF.idleFrame, pattern: [2, 1, 0, 1] };
};
// isEmfCharacter - Check whether a customly animated sprites
Game_CharacterBase.prototype.isEmfCharacter = function() {
return this._isEmfCharacter;
};
// emfCharacterState - makes this._emfCharacterState public
Game_CharacterBase.prototype.emfCharacterState = function() {
return this._emfCharacterState;
};
// setImage - adjusts to call EMF setup method
ModernAlgebra.EMF.GameCharacterBase_setImage =
Game_CharacterBase.prototype.setImage;
Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
const [oldCharName, oldCharIndex] = [this.characterName(), this.characterIndex()]
ModernAlgebra.EMF.GameCharacterBase_setImage.apply(this, arguments); // original method
this.maemfSetupEmfCharacter();
if(oldCharName !== characterName) {this.resetPattern();}
if(oldCharName === characterName && oldCharIndex !== characterIndex) {this.resetPattern();}
};
// maSetupEmfCharacter - setup custom animation sprite
Game_CharacterBase.prototype.maemfSetupEmfCharacter = function() {
this.maClearEmfCharacterState();
var charName = this.characterName();
if (ImageManager.isEmfCharacter(charName)) {
var sign = charName.match(/(?:\%[\(\[])[\d\s]+(?:[\)\]])/);
var signArgs = sign[0].match(/\d+/g); // array of digit strings
if (signArgs) {
this._isEmfCharacter = true;
// Map arguments in file name to an array of numbers
signArgs = signArgs.map(Number);
signArgsLength = signArgs.length;
this.emfCharacterState().frameNum = signArgs.shift();
this.emfCharacterState().idleFrame = (signArgsLength > 1) ? signArgs.shift() : ModernAlgebra.EMF.idleFrame;
if (signArgsLength > 2) {
this.emfCharacterState().pattern = signArgs;
} else {
var success = false;
// Check for a default match for this number of frames
for (var i = 0; i < ModernAlgebra.EMF.defaultPattern.length; i++) {
if (ModernAlgebra.EMF.defaultPattern[i][0] === this.emfCharacterState().frameNum) {
this.emfCharacterState().idleFrame = ModernAlgebra.EMF.defaultPattern[i][1];
this.emfCharacterState().pattern = ModernAlgebra.EMF.defaultPattern[i].slice(2, (ModernAlgebra.EMF.defaultPattern[i].length));
success = true;
break;
}
}
// If still no pattern specified
if (!success) {
// Populate pattern with a simple cycle starting after idle
this.emfCharacterState().pattern = [];
var idleFramePlus = this.emfCharacterState().idleFrame + 1;
for (var i = 0; i < this.emfCharacterState().frameNum; i++) {
this.emfCharacterState().pattern.push((i + idleFramePlus) % this.emfCharacterState().frameNum);
}
}
}
}
}
};
// animationWait
ModernAlgebra.EMF.GameCharacterBase_animationWait =
Game_CharacterBase.prototype.animationWait;
Game_CharacterBase.prototype.animationWait = function() {
// If EMF Character
if (this.isEmfCharacter()) {
var realSpeed = this.realMoveSpeed();
var frameNum = this.maxPattern();
return Math.floor((8 - realSpeed)*(ModernAlgebra.EMF.cycleTime / (4*frameNum))); // CycleTime divided by number of frames in animation
} else {
// Run Default Method - approx. 60 frames at normal speed
return ModernAlgebra.EMF.GameCharacterBase_animationWait.apply(this, arguments) // original method
}
};
// maxPattern
ModernAlgebra.EMF.GameCharacterBase_maxPattern =
Game_CharacterBase.prototype.maxPattern;
Game_CharacterBase.prototype.maxPattern = function() {
if (this.isEmfCharacter()) {
return this.emfCharacterState().pattern.length; // Length of pattern array
} else {
return ModernAlgebra.EMF.GameCharacterBase_maxPattern.apply(this, arguments); // original method
}
};
// pattern
ModernAlgebra.EMF.GameCharacterBase_pattern =
Game_CharacterBase.prototype.pattern;
Game_CharacterBase.prototype.pattern = function() {
if (this.isEmfCharacter()) {
if (this._pattern < 0) {
return this.emfCharacterState().idleFrame; // Idle Frame if _pattern < 0
} else {
var patternIndex = (this._pattern % this.emfCharacterState().pattern.length);
return this.emfCharacterState().pattern[patternIndex]; // index of pattern array
}
} else {
return ModernAlgebra.EMF.GameCharacterBase_pattern.apply(this, arguments); // original method
}
};
// isOriginalPattern - Original pattern is -1 for custom sprites
ModernAlgebra.EMF.GameCharacterBase_isOriginalpattern =
Game_CharacterBase.prototype.isOriginalPattern;
Game_CharacterBase.prototype.isOriginalPattern = function() {
if (this.isEmfCharacter()) {
return this.pattern() === -1;
} else {
return ModernAlgebra.EMF.GameCharacterBase_isOriginalpattern.apply(this, arguments); // original method
}
};
// straighten - Straighten to original pattern
ModernAlgebra.EMF.GameCharacterBase_straighten =
Game_CharacterBase.prototype.straighten;
Game_CharacterBase.prototype.straighten = function() {
if (this.isEmfCharacter()) {
if (this.hasWalkAnime() || this.hasStepAnime()) {
this._pattern = -1;
}
this._animationCount = 0;
} else {
ModernAlgebra.EMF.GameCharacterBase_straighten.apply(this, arguments)
}
};
// resetPattern - Idle is -1 for custom sprites
ModernAlgebra.EMF.GameCharacterBase_resetPattern =
Game_CharacterBase.prototype.resetPattern;
Game_CharacterBase.prototype.resetPattern = function() {
if (this.isEmfCharacter()) {
this.setPattern(-1);
} else {
ModernAlgebra.EMF.GameCharacterBase_resetPattern.apply(this, arguments); // original method
}
};
//=========================================================================
// Game_Event
//=========================================================================
// setupPageSettings - adjust original pattern
ModernAlgebra.EMF.GameEvent_setupPageSettings =
Game_Event.prototype.setupPageSettings;
Game_Event.prototype.setupPageSettings = function() {
ModernAlgebra.EMF.GameEvent_setupPageSettings.apply(this, arguments);
// Original pattern is always idle for custom sprites
if (this.isEmfCharacter()) { this._originalPattern = -1; }
this.resetPattern();
};
//=========================================================================
// Sprite_Character
//=========================================================================
// patternWidth - afjust based on number of frames
ModernAlgebra.EMF.SpriteCharacter_patternWidth =
Sprite_Character.prototype.patternWidth;
Sprite_Character.prototype.patternWidth = function() {
var pw = ModernAlgebra.EMF.SpriteCharacter_patternWidth.apply(this, arguments)
if (this._character.isEmfCharacter()) {
var frameNum = this._character.emfCharacterState().frameNum;
return ((pw*3) / frameNum);
} else {
return pw;
}
};
})();

View file

@ -0,0 +1,318 @@
//=============================================================================
// TDS Extra Followers
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_ExtraFollowers = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.ExtraFollowers = _TDS_.ExtraFollowers || {};
//=============================================================================
/*:
* @plugindesc
* This plugin allows you to add extra followers to your party.
*
* @param Max Extra Followers
* @desc Max amount of Extra Followers to add.
* @default 4
*
* @author TDS
*
* @help
* ============================================================================
* * Script Calls
* ============================================================================
*
* To clear all extra followers use the following script
* call:
*
* this.clearExtraFollowers();
*
*
*
*
* To add an extra follower use the following script call:
*
*
* this.addExtraFollower(ID, NAME, INDEX, POSITION);
*
* ID
* ^ Id used for tracking the follower.
*
* NAME:
* ^ Graphics name.
*
* INDEX:
* ^ Graphics Index.
*
* POSITION
* ^ Position of the extra follower. (1~8)
* (Optional: Defaults to the last available position.)
*
* Examples:
*
* this.addExtraFollower('OldMan', 'FA_CHURCH_MARKET', 1);
*
*
* this.addExtraFollower('girl', 'FA_CHURCH_MARKET', 3, 6);
*
*
*
*
* To remove an extra follower use the following script call:
*
* this.removeExtraFollower(POSITION);
*
* POSITION:
* ^ Position of the extra follower. (1~8);
* (Optional: Defaults to the last position.)
*
*
* Examples:
*
* this.removeExtraFollower();
*
* this.removeExtraFollower(5);
*
*
*
* To remove an extra follower by it's ID use the following
* script call:
*
* $gamePlayer._followers.removeExtraFollower(ID);
*
* ID
* ^ Follower Id.
*
* Examples:
*
* this.removeFollowerById('OldMan')
*
*/
//=============================================================================
// Node.js path
var path = require('path');
// Get Parameters
var parameters = PluginManager.parameters("Extra_Followers");
// Initialize Parameters
_TDS_.ExtraFollowers.params = {};
_TDS_.ExtraFollowers.params.maxExtraFollowers = Number(parameters['Max Extra Followers'] || 4);
//=============================================================================
// ** Game_Followers
//-----------------------------------------------------------------------------
// The wrapper class for a follower array.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ExtraFollowers.Game_Followers_initialize = Game_Followers.prototype.initialize;
//=============================================================================
// * Object Initialization
//=============================================================================
Game_Followers.prototype.initialize = function() {
// Run Original Function
_TDS_.ExtraFollowers.Game_Followers_initialize.call(this);
// Extra Start
var extraStart = this._data.length;
for (var i = 0; i < _TDS_.ExtraFollowers.params.maxExtraFollowers; i++) {
this._data.push(new Game_Follower(extraStart + i + 1))
};
};
//=============================================================================
// * Add Extra Follower Last
//=============================================================================
Game_Followers.prototype.nextExtraFollowerSlot = function() {
// Get Starting Index
var index = $gameParty.maxBattleMembers()-1;
// Go Through Data
for (var i = index; i < this._data.length; i++) {
// Get Follower
var follower = this._data[i];
// Set Index
index = i;
// If Follower Graphics data is undefined
if (follower._graphicsData === undefined) { break; }
};
// Return Index
return index;
};
//=============================================================================
// * Last Extra Follower Slot
//=============================================================================
Game_Followers.prototype.lastExtraFollowerSlot = function() {
// Start
var start = $gameParty.maxBattleMembers()-1;
// Get Starting Index
var index = this._data.length-1
// Go Through Data in reverse
for (var i = this._data.length-1; i >= start; i--) {
// Get Follower
var follower = this._data[i];
// Set Index
index = i;
if (follower._graphicsData !== undefined) { break; }
};
// Return Index
return index;
};
//=============================================================================
// * Clear Extra Followers
//=============================================================================
Game_Followers.prototype.clearExtraFollowers = function() {
// Go Through Data
for (var i = 0; i < this._data.length; i++) {
// Get Follower
var follower = this._data[i];
// Delete Follower Graphics Data
delete follower._graphicsData;
};
// Refresh
this.refresh();
};
//=============================================================================
// * Add Extra Follower
//=============================================================================
Game_Followers.prototype.addExtraFollower = function(id, name, index, cIndex) {
// Set default character index
if (cIndex === undefined) { cIndex = this.nextExtraFollowerSlot(); };
// Follower Object
var follower = this._data[cIndex];
// Set Graphics Data
follower._graphicsData = {id: id, name: name, index: index};
// Refresh
this.refresh();
};
//=============================================================================
// * Add Extra Follower
//=============================================================================
Game_Followers.prototype.removeExtraFollower = function(index) {
// Set Default Index
if (index === undefined) { index = this.lastExtraFollowerSlot(); };
// Follower Object
var follower = this._data[index];
// Delete Graphics Data
delete follower._graphicsData;
// Realign Extra Followers
this.realignExtraFollowers();
// Refresh
this.refresh();
};
//=============================================================================
// * Remove Follower By ID
//=============================================================================
Game_Followers.prototype.removeFollowerById = function(id) {
// Go Through Data
for (var i = 0; i < this._data.length; i++) {
// Get Follower
var follower = this._data[i];
// If Follower Graphics Data matches the ID
if (follower._graphicsData && follower._graphicsData.id === id) {
delete follower._graphicsData;
};
};
// Realign Extra Followers
this.realignExtraFollowers();
// Refresh
this.refresh();
};
//=============================================================================
// * Realign Extar Followers
//=============================================================================
Game_Followers.prototype.realignExtraFollowers = function(index) {
var graphics = this._data.filter(function(follower) {
return follower._graphicsData !== undefined;
});
// Get Starting Index
var index = $gameParty.maxBattleMembers()-1;
// Go Through Data
for (var i = index; i < this._data.length; i++) {
// Get Follower
var follower = this._data[i];
// Get Data
var data = graphics[i - index];
// Get Graphics Data
var graphicsData = data ? Object.assign({}, data._graphicsData) : null;
// Delete Follower Data
delete follower._graphicsData
// If Graphics DAta
if (graphicsData) {
// Set Graphics Data
follower._graphicsData = graphicsData;
};
};
};
//=============================================================================
// ** Game_Follower
//-----------------------------------------------------------------------------
// The game object class for a follower. A follower is an allied character,
// other than the front character, displayed in the party.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.ExtraFollowers.Game_Follower_isVisible = Game_Follower.prototype.isVisible;
_TDS_.ExtraFollowers.Game_Follower_refresh = Game_Follower.prototype.refresh;
//=============================================================================
// * Determine if visible
//=============================================================================
Game_Follower.prototype.isVisible = function() {
// Return true if follower has graphics data
if ($gamePlayer.followers().isVisible() && this._graphicsData) { return true; };
// Return default
return _TDS_.ExtraFollowers.Game_Follower_isVisible.call(this);
};
//=============================================================================
// * Add Extra Follower
//=============================================================================
Game_Follower.prototype.refresh = function() {
// If Graphics Data Exists
if (this._graphicsData) {
this.setImage(this._graphicsData.name, this._graphicsData.index);
} else {
// Run Original Function
_TDS_.ExtraFollowers.Game_Follower_refresh.call(this);
}
};
//=============================================================================
// ** Game_Interpreter
//-----------------------------------------------------------------------------
// The interpreter for running event commands.
//=============================================================================
// * Clear Extra Followers
//=============================================================================
Game_Interpreter.prototype.clearExtraFollowers = function() {
// Clear Extra Followers
$gamePlayer._followers.clearExtraFollowers();
};
//=============================================================================
// * Add Extra Follower
//=============================================================================
Game_Interpreter.prototype.addExtraFollower = function(id, name, index, cIndex) {
// Add Extra Follower
$gamePlayer._followers.addExtraFollower(id, name, index, cIndex);
};
//=============================================================================
// * Remove Extra Follower
//=============================================================================
Game_Interpreter.prototype.removeExtraFollower = function(index) {
// Remove Extra Follower
$gamePlayer._followers.removeExtraFollower(index);
};
//=============================================================================
// * Remove Extra Follower by ID
//=============================================================================
Game_Interpreter.prototype.removeFollowerById = function(id) {
// Remove Extra Follower
$gamePlayer._followers.removeFollowerById(id);
};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,28 @@
/*:
* @plugindesc Filter Controller Blur Quality Patch
* v 1.01 - replaced Kawase Blur with regular Guassin
* @author Anisoft (aka Dairnon)
*
* @help
*
* This adds a new quality param after the blur ammount param.
* To use simply just add the amount u want after amount param
*
*
* Ex:
*
* setFilter id amount quality
*
* setFilter 0 32 8
*
*
*/
Filter_Controller.defaultFilterParam["blur"] = [8, 4];
Filter_Controller.filterNameMap["blur"] = PIXI.filters.BlurFilter; // -> No KawaseBlur: slow
(function($) {
$.blur = function(filter, cp) {
filter.blur = cp[0];
cp[1] ? filter.quality = cp[1] : null;
}
})(Filter_Controller.updateFilterHandler);

View file

@ -0,0 +1,182 @@
//=============================================================================
// TDS Follower Control
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_FollowerControl = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.FollowerControl = _TDS_.FollowerControl || {};
//=============================================================================
// ** Game_Follower
//-----------------------------------------------------------------------------
// The game object class for a follower. A follower is an allied character,
// other than the front character, displayed in the party.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.FollowerControl.Game_Follower_initialize = Game_Follower.prototype.initialize;
_TDS_.FollowerControl.Game_Follower_update = Game_Follower.prototype.update;
_TDS_.FollowerControl.Game_Follower_chaseCharacter = Game_Follower.prototype.chaseCharacter;
//=============================================================================
// * Object Initialization
//=============================================================================
Game_Follower.prototype.initialize = function(memberIndex) {
// Set Released Flag
this._released = false;
// Run Original Function
_TDS_.FollowerControl.Game_Follower_initialize.call(this, memberIndex);
};
//=============================================================================
// * Release/Enslave
//=============================================================================
Game_Follower.prototype.release = function() { this._released = true; };
Game_Follower.prototype.enslave = function() { this._released = false; };
//=============================================================================
// * Determine if Follower is Free
//=============================================================================
Game_Follower.prototype.isFree = function() { return this._released; };
//=============================================================================
// * Frame Update
//=============================================================================
Game_Follower.prototype.update = function() {
// If Free
if (this.isFree()) {
// Update Character
Game_Character.prototype.update.call(this);
return;
};
// Run Original Function
_TDS_.FollowerControl.Game_Follower_update.call(this);
};
//=============================================================================
// * Chase Character
//=============================================================================
Game_Follower.prototype.chaseCharacter = function(character) {
// If Free
if (this.isFree()) { return; };
// Run Original Function
_TDS_.FollowerControl.Game_Follower_chaseCharacter.call(this, character);
};
//=============================================================================
// * Refresh
//=============================================================================
Game_Follower.prototype.refresh = function() {
var characterName = this.characterName();
var characterIndex = this.characterIndex()
this.setImage(characterName, characterIndex);
};
//=============================================================================
// * Character Name
//=============================================================================
Game_Follower.prototype.characterName = function() {
// If Visible
if (this.isVisible()) {
if (this.actor().isDead()) { return '$Toast'; }
return this.actor().characterName();
};
// Return Empty String
return '';
};
//=============================================================================
// * Character Index
//=============================================================================
Game_Follower.prototype.characterIndex = function() {
// If Visible
if (this.isVisible()) {
if (this.actor().isDead()) { return 5; }
return this.actor().characterIndex();
};
return 0;
};
//=============================================================================
// ** Window_Base
//-----------------------------------------------------------------------------
// The interpreter for running event commands.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.FollowerControl.Game_Interpreter_clear = Game_Interpreter.prototype.clear;
_TDS_.FollowerControl.Game_Interpreter_character = Game_Interpreter.prototype.character;
//=============================================================================
// * Clear
//=============================================================================
Game_Interpreter.prototype.clear = function() {
// Run Original Function
_TDS_.FollowerControl.Game_Interpreter_clear.call(this);
// Clear Follower Character
this.clearFollower();
};
//=============================================================================
// * Get Follower
//=============================================================================
Game_Interpreter.prototype.getFollower = function(index) { return $gamePlayer.followers().follower(index); };
//=============================================================================
// * Release Follower
//=============================================================================
Game_Interpreter.prototype.releaseFollower = function(index) {
// Get Follower
var follower = this.getFollower(index);
// Release Follower
if (follower) { follower.release(); }
};
//=============================================================================
// * Enslave Follower
//=============================================================================
Game_Interpreter.prototype.enslaveFollower = function(index) {
// Get Follower
var follower = this.getFollower(index);
// Release Follower
if (follower) { follower.enslave(); }
};
//=============================================================================
// * Set Follower Character
//=============================================================================
Game_Interpreter.prototype.controlFollower = function(index, release) {
// If Release is undefined
if (release === undefined) { release = true; }
// Set Follower Character
this._followerCharacter = this.getFollower(index);
// Release Follower Character
if (release) { this._followerCharacter.release(); }
};
//=============================================================================
// * Clear Follower Character
//=============================================================================
Game_Interpreter.prototype.clearFollower = function(index, enslave) {
// If Enslaved is undefined
if (enslave === undefined) { enslave = true; }
// Enslave Character
if (enslave && this._followerCharacter) { this._followerCharacter.enslave(); }
// Set Follower Character to null
this._followerCharacter = null;
};
//=============================================================================
// * Get Character
//=============================================================================
Game_Interpreter.prototype.character = function(param) {
// If Follower Character
if (this._followerCharacter) {
// Get Character
var character = this._followerCharacter;
// Return Character
return character;
};
// Return Original Function
return _TDS_.FollowerControl.Game_Interpreter_character.call(this, param);
};
// this.isVisible() ? this.actor().characterIndex() : 0;
// characterName = //'!Flame';
// characterIndex = 5;
// if (this._memberIndex === 1) {
// characterName = '!Flame';
// characterIndex = 4;
// };

View file

@ -0,0 +1,38 @@
//=============================================================================
// Fullscreen.js
//=============================================================================
/*:
* @plugindesc Starts the game in fullscreen
* @author Christian Schicho
*
* @help
*/
; (function () {
function extend(obj, name, func) {
var orig = obj.prototype[name]
obj.prototype[name] = function () {
orig.call(this)
func.call(this)
}
}
extend(Scene_Boot, 'start', function () {
Graphics._switchFullScreen();
})
var _Scene_Base_create = Scene_Base.prototype.create;
Scene_Base.prototype.create = function () {
const w = 640;
const h = 480;
_Scene_Base_create.call(this);
Graphics.width = w;
Graphics.height = h;
Graphics.boxHeight = h;
Graphics.boxWidth = w;
};
})()

View file

@ -0,0 +1,277 @@
//-----------------------------------------------------------------------------
// Galv's Animated Splash Screens
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_AnimatedSplashScreens.js
//-----------------------------------------------------------------------------
// 2016-10-22 - Version 1.1 - fixed database battle tst
// 2016-04-25 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_AnimatedSplashScreens = true;
var Galv = Galv || {}; // Galv's main object
Galv.ASPLASH = Galv.ASPLASH || {}; // Galv's stuff
//-----------------------------------------------------------------------------
/*:
* @plugindesc (v.1.1) Set up animated splash screens that show before the title screen.
*
* @author Galv - galvs-scripts.com
*
* @param ----- SPLASH SCREENS -----
* @desc
* @default
*
* @param Splash Images
* @desc image,timer,fade,animId - See help file for more info.
* @default image,150,8,0|image,150,8,0
*
* @param Splash Background
* @desc The color (eg. #000000) or image (from /img/system/) of background during splash images
* @default #333
*
* @param Splash Skip
* @desc Skip option can be: ALL (to skip all images), ONE (to skip just one), NONE (disable skipping)
* @default ONE
*
* @help
* Galv's Animated Splash Screens
* ----------------------------------------------------------------------------
* This plugin allows you to make animated splash screens that display before
* the title screen. All splash images used in this plugin are taken from:
* /img/system/
*
* The "Splash Images" plugin setting is where you set up all your splash
* images and you can have as many as you like.
* Each splash image has the following required values:
*
* image,timer,fade,animId
*
* image - the image name from /img/system/ folder
* timer - how many frames the image will remain on the screen
* fade - the speed the image fades in/out (lower is slower)
* animId - the animation played (from database) when image is faded in
*
* You can have multiple splash images separated by "|" symbol.
* EXAMPLE:
* image1,150,8,3|image2,150,8,2|image3,150,8,0
* ----------------------------------------------------------------------------
*/
//-----------------------------------------------------------------------------
// CODE STUFFS
//-----------------------------------------------------------------------------
(function() {
Galv.ASPLASH.splashed = false;
// Splash Screens
Galv.ASPLASH.splashImgs = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Images"].split("|");
for (i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
var array = new Object(Galv.ASPLASH.splashImgs[i].split(","));
Galv.ASPLASH.splashImgs[i] = {};
Galv.ASPLASH.splashImgs[i].image = array[0];
Galv.ASPLASH.splashImgs[i].timer = Number(array[1]);
Galv.ASPLASH.splashImgs[i].fade = Number(array[2]);
Galv.ASPLASH.splashImgs[i].anim = Number(array[3]);
};
Galv.ASPLASH.splashBg = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Background"];
Galv.ASPLASH.splashSkip = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Skip"].toLowerCase();
Galv.ASPLASH.Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages;
Scene_Boot.loadSystemImages = function() {
Galv.ASPLASH.Scene_Boot_loadSystemImages.call(this);
for (var i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
ImageManager.loadSystem(Galv.ASPLASH.splashImgs[i].image);
};
};
// SCENE SPLASHSCREENS
//-----------------------------------------------------------------------------
Galv.ASPLASH.SceneManager_goto = SceneManager.goto;
SceneManager.goto = function(sceneClass) {
if (!Galv.ASPLASH.splashed && $dataActors && !DataManager.isBattleTest()) {
if(!!StorageManager.exists(44)) {
Galv.ASPLASH.splashed = true;
return Galv.ASPLASH.SceneManager_goto.call(this,sceneClass);
}
sceneClass = Scene_SplashScreens
}; // if no splash has played this boot, steal scene
Galv.ASPLASH.SceneManager_goto.call(this,sceneClass);
};
// SCENE SPLASHSCREENS
//-----------------------------------------------------------------------------
function Scene_SplashScreens() {
this.initialize.apply(this, arguments);
}
Scene_SplashScreens.prototype = Object.create(Scene_Base.prototype);
Scene_SplashScreens.prototype.constructor = Scene_SplashScreens;
Scene_SplashScreens.prototype.initialize = function() {
Scene_Base.prototype.initialize.call(this);
};
Scene_SplashScreens.prototype.create = function() {
Scene_Base.prototype.create.call(this);
this.setVars();
this.createBackground();
this.createSplashes();
};
Scene_SplashScreens.prototype.setVars = function() {
this._splashIndex = 0; // the splash being displayed
this._ticker = 0; // length timer
this._fadeIn = true; // fadein start
};
Scene_SplashScreens.prototype.createBackground = function() {
if (Galv.ASPLASH.splashBg[0] == "#") {
var w = Graphics.boxWidth;
var h = Graphics.boxHeight;
this._backSprite = new Sprite();
this._backSprite.bitmap = new Bitmap(w,h);
this._backSprite.bitmap.fillRect(0, 0, w, h, Galv.ASPLASH.splashBg);
} else {
this._backSprite = new Sprite(ImageManager.loadSystem(Galv.ASPLASH.splashBg));
this.centerSprite(this._backSprite);
};
this.addChild(this._backSprite);
};
Scene_SplashScreens.prototype.createSplashes = function() {
this._sprites = [];
for (i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
this._sprites[i] = new Sprite_SplashImage(i);
this.centerSprite(this._sprites[i]);
this.addChild(this._sprites[i]);
};
};
Scene_SplashScreens.prototype.centerSprite = function(sprite) {
sprite.x = Graphics.width / 2;
sprite.y = Graphics.height / 2;
sprite.anchor.x = 0.5;
sprite.anchor.y = 0.5;
};
Scene_SplashScreens.prototype.sprite = function() {
return this._sprites[this._splashIndex];
};
Scene_SplashScreens.prototype.splash = function() {
return Galv.ASPLASH.splashImgs[this._splashIndex];
};
Scene_SplashScreens.prototype.start = function() {
Scene_Base.prototype.start.call(this);
SceneManager.clearStack();
this.centerSprite(this._backSprite);
this.startFadeIn(this.fadeSpeed(), false);
};
Scene_SplashScreens.prototype.update = function() {
Scene_Base.prototype.update.call(this);
this.updateSplash();
};
Scene_SplashScreens.prototype.updateSplash = function() {
if (this._fadeIn) {
this.sprite().opacity += this.splash().fade;
if (this.sprite().opacity >= 255) {
this._fadeIn = false;
this.sprite().doAnim();
};
} else {
if (this._ticker < this.splash().timer) {
this._ticker++;
} else {
this.sprite().opacity -= this.splash().fade;
if (this.sprite().opacity <= 0) {
if (!this._sprites[this._splashIndex + 1]) return this.endSplashes();
this._splashIndex++;
this._fadeIn = true;
this._ticker = 0;
};
};
};
if (Input.isTriggered('ok')) {
if (Galv.ASPLASH.splashSkip == 'one') {
this._ticker = this.splash().timer;
this._fadeIn = false;
} else if (Galv.ASPLASH.splashSkip == 'all') {
this._ticker = this.splash().timer;
this._fadeIn = false;
this._sprites[this._splashIndex + 1] = null;
};
};
};
Scene_SplashScreens.prototype.endSplashes = function() {
Galv.ASPLASH.splashed = true;
// SceneManager.goto(Scene_Title);
SceneManager.goto(Scene_OmoriTitleScreen);
};
// SPRITE SPLASH
//-----------------------------------------------------------------------------
function Sprite_SplashImage() {
this.initialize.apply(this, arguments);
}
Sprite_SplashImage.prototype = Object.create(Sprite_Base.prototype);
Sprite_SplashImage.prototype.constructor = Sprite_SplashImage;
Sprite_SplashImage.prototype.initialize = function(index) {
Sprite_Base.prototype.initialize.call(this);
this.bitmap = ImageManager.loadSystem(Galv.ASPLASH.splashImgs[index].image)
this.opacity = 0;
this._index = index;
};
Sprite_SplashImage.prototype.doAnim = function() {
this._animId = Galv.ASPLASH.splashImgs[this._index].anim;
};
Sprite_SplashImage.prototype.update = function() {
Sprite_Base.prototype.update.call(this);
this.updateAnimation();
};
Sprite_SplashImage.prototype.updateAnimation = function() {
this.setupAnimation();
if (!this.isAnimationPlaying()) {
this._animationPlaying = false;
}
};
Sprite_SplashImage.prototype.setupAnimation = function() {
if (this._animId > 0) {
var animation = $dataAnimations[this._animId];
this.startAnimation(animation, false, 0);
this._animId = 0;
this._animationPlaying = true;
}
};
})();

View file

@ -0,0 +1,264 @@
//-----------------------------------------------------------------------------
// Galv's Cam Control
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_CamControl.js
// With some fixes by Anisoft
//-----------------------------------------------------------------------------
// 2016-05-02 - Version 2.0 - compatibilty with zooming and offset fixes
// - by Anisoft
// 2016-04-18 - Version 1.9 - fixed a bug with saving while cam disabled
// 2016-03-16 - Version 1.8 - transferring player to same map no longer moves
// - the camera if it has a different target.
// 2015-12-30 - Version 1.7 - another fix for shuttering issue
// 2015-12-17 - Version 1.6 - put in code to fix potential shuttering issue
// 2015-12-17 - Version 1.5 - fixed an issue that enabled the disabled cam
// 2015-12-01 - Version 1.4 - minor code changes
// 2015-12-01 - Version 1.3 - missed part of the last bug. Fixed now.
// 2015-11-30 - Version 1.2 - fixed bug with loading game and target breaking
// 2015-11-27 - Version 1.1 - added tile size option
// 2015-11-27 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_CamControl = true;
var Galv = Galv || {}; // Galv's main object
Galv.pCmd = Galv.pCmd || {}; // Plugin Command manager
Galv.CC = Galv.CC || {}; // Galv's stuff
//-----------------------------------------------------------------------------
/*:
* @plugindesc Allows greater control over where the game camera is focused. View HELP for plugin commands.
*
* @author Galv - galvs-scripts.com
*
* @param Tile Size
* @desc Default 48. Only change if you change tile size in your game
* @default 48
*
* @help
* Galv's Cam Control
* ----------------------------------------------------------------------------
* This plugin creates a sliding movement for the camera as well as allows you
* to set the target position of it to wherever required. (Player, event, xy)
*
* ----------------------------------------------------------------------------
* PLUGIN COMMANDS
* ----------------------------------------------------------------------------
* CAM PLAYER SPD // Set camera focus to player.
* // CAM - the plugin command word
* // PLAYER - command word to choose player
* // SPD - speed camera scrolls to target
* // v# to use a variable
* // default scroll speed is 800
* // leave speed blank for default
*
* CAM EVENT ID SPD // Set camera focus to an event.
* // CAM - the plugin command word
* // EVENT - command word to choose event
* // ID - the event's id
* // v# to use a variable
* // SPD - speed camera scrolls to target
* // v# to use a variable
* // default scroll speed is 800
* // leave speed blank for default
*
* CAM X Y SPD // Set camera focus to an x,y position.
* // CAM - the plugin command word
* // X - the position on the map
* // Y - the position on the map
* // v# to use variables
* // SPD - speed camera scrolls to target
* // v# to use a variable
* // default scroll speed is 800
* // leave speed blank for default
*
* CAM DISABLE // Sets the focus on player and disables the
* // sliding motion. (RPGMaker default);
* // Using any command above will enable again
*
* NOTE: The higher the SPD value for these commands, the slower the movement.
* Not recommended to use speeds that are too fast.
*
* EXAMPLES
* CAM PLAYER // Camera focuses on player at speed 800
* CAM PLAYER 1600 // Camera focuses on player at speed 1600 (slower)
* CAM EVENT 3 // Camera focuses on event 3 at speed 800
* CAM EVENT 12 400 // Camera focuses on event 12 at speed 400 (faster)
* CAM 23 18 // Camera focuses on x23, y18 position on the map
*/
//-----------------------------------------------------------------------------
// CODE STUFFS
//-----------------------------------------------------------------------------
(function() {
Galv.CC.size = Number(PluginManager.parameters('Galv_CamControl')["Tile Size"]);
// OVERWRITE - BECAUSE OF JITTER
Game_Map.prototype.displayX = function() {return Math.round(this._displayX * Galv.CC.size) / Galv.CC.size};
Game_Map.prototype.displayY = function() {return Math.round(this._displayY * Galv.CC.size) / Galv.CC.size};
// GALV'S PLUGIN MANAGEMENT. INCLUDED IN ALL GALV PLUGINS THAT HAVE PLUGIN COMMAND CALLS, BUT ONLY RUN ONCE.
if (!Galv.aliased) {
var Galv_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
if (Galv.pCmd[command]) {
Galv.pCmd[command](args);
return;
};
Galv_Game_Interpreter_pluginCommand.call(this, command, args);
};
Galv.aliased = true; // Don't keep aliasing for other Galv scripts.
};
// Direct to Plugin Object
Galv.pCmd.CAM = function(arguments) {
Galv.CC.camControl(arguments);
};
// END GALV'S PLUGIN MANAGEMENT
Galv.CC.camControl = function(args) {
var key = args[0].toLowerCase();
var speed = 100;
switch (key) {
case "player":
var target = $gamePlayer;
if (args[1]) speed = Galv.CC.getValue(args[1]);
break;
case "event":
var eId = Galv.CC.getValue(args[1]);
var target = $gameMap.event(eId);
if (args[2]) speed = Galv.CC.getValue(args[2]);
break;
case "disable":
$gameMap.camTarget = $gamePlayer;
$gameMap.camNorm = true;
$gameMap.savedCamTarget = null;
return;
default:
var px = Galv.CC.getValue(args[0]);
var py = Galv.CC.getValue(args[1]);
if (args[2]) speed = Galv.CC.getValue(args[2]);
var target = {
x: px,
y: py,
_realX: px,
_realY: py,
screenX: Game_CharacterBase.prototype.screenX,
screenY: function() {
var th = $gameMap.tileHeight();
return Math.round(this.scrolledY() * th + th);
},
scrolledX: Game_CharacterBase.prototype.scrolledX,
scrolledY: Game_CharacterBase.prototype.scrolledY
};
};
$gameMap.camTargetSet(target,speed);
$gameMap.savedCamTarget = args;
};
Galv.CC.getValue = function(string) {
if (string[0].toLowerCase() === "v") {
// Use variable
var varId = Number(string.replace("v",""));
return $gameVariables.value(varId);
} else {
return Number(string);
};
};
// GAME PLAYER
Galv.CC.Game_Player_updateScroll = Game_Player.prototype.updateScroll;
Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
if ($gameMap.camNorm) return Galv.CC.Game_Player_updateScroll.call(this,lastScrolledX, lastScrolledY);
};
// GAME MAP
Galv.CC.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function() {
Galv.CC.Scene_Map_onMapLoaded.call(this);
if (!$gameMap.camNorm) {
$gameMap.savedCamTarget = $gameMap.savedCamTarget || ["PLAYER"];
Galv.CC.camControl($gameMap.savedCamTarget);
};
};
Galv.CC.Game_Map_setup = Game_Map.prototype.setup;
Game_Map.prototype.setup = function(mapId) {
this.zoom = this.zoom || new PIXI.Point(1,1);
if (!this.camNorm) {
this.camTargetSet($gamePlayer,800);
this.savedCamTarget = ["PLAYER"];
};
Galv.CC.Game_Map_setup.call(this,mapId);
};
Game_Map.prototype.camTargetSet = function(target,speed) {
this.camTarget = target;
this.camNorm = false;
this.camSpeed = speed || 800;
};
Galv.CC.Game_Map_updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function() {
if (this.camNorm) return Galv.CC.Game_Map_updateScroll.call(this);
this._scrollRest = 0;
var cw = (Graphics.boxWidth / 2);
var ch = (Graphics.boxHeight / 2);
var screenX = this.camTarget.screenX()*this.zoom.x;
var screenY = this.camTarget.screenY()*this.zoom.y;
var sx = Math.abs(screenX - cw) / this.camSpeed;
var sy = Math.abs(screenY - ch) / this.camSpeed;
if (sx < 0.005) (sx = 0);
if (sy < 0.005) (sy = 0);
var x_pos = screenX;
var y_pos = screenY;
if (y_pos < ch) {
this.scrollUp(sy);
} else if (y_pos > ch) {
this.scrollDown(sy);
};
if (x_pos < cw) {
this.scrollLeft(sx);
} else if (x_pos > cw) {
this.scrollRight(sx);
};
};
Galv.CC.Game_Player_center = Game_Player.prototype.center;
Game_Player.prototype.center = function(x, y) {
if ($gameMap.camTarget == $gamePlayer || $gameMap.camNorm) {
return Galv.CC.Game_Player_center.call(this,x,y);
};
};
Game_Player.prototype.centerX = function() {
return ((Graphics.width / $gameMap.tileWidth() - (1*$gameMap.zoom.x)) / 2.0)/$gameMap.zoom.x;
};
Game_Player.prototype.centerY = function() {
return ((Graphics.height / $gameMap.tileHeight() - 1.75*$gameMap.zoom.y) / 2.0)/$gameMap.zoom.y;
};
})();

View file

@ -0,0 +1,568 @@
//-----------------------------------------------------------------------------
// Galv's Event Detectors
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_EventDetectors.js
//-----------------------------------------------------------------------------
// 2016-08-21 - Version 1.2 - fixes to 'non detected' frequency
// 2016-08-20 - Version 1.1 - fixed bug when no terrain or regions specified
// 2016-08-01 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_EventDetectors = true;
var Galv = Galv || {}; // Galv's main object
Galv.DETECT = Galv.DETECT || {}; // Galv's stuff
//-----------------------------------------------------------------------------
/*:
* @plugindesc Have events activate when player gets in range and line of sight.
*
* @author Galv - galvs-scripts.com
*
* @param LOS Blocking Terrain
* @desc Terrain tag ID's for tiles that block line of sight, separated by commas
* @default 5,6
*
* @param LOS Blocking Regions
* @desc Region ID's for tiles that block line of sight, separated by commas
* @default 1,2
*
* @param Tile Size
* @desc The pixel size of the tiles you are using.
* Default: 48
* @default 48
*
* @param Search Limit
* @desc Amount of checks for default pathfinding. Larger might cause lag, smaller might make returning home fail
* Default: 12
* @default 24
*
* @param --- Behaviors ---
* @desc
* @default
*
* @param Behavior 0
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 1
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 2
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 3
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 4
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 5
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 6
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 7
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 8
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 9
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 10
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 11
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 12
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 13
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 14
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 15
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 16
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 17
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 18
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 19
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @param Behavior 20
* @desc Behavior of event if detecting. (see help file)
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
* @default
*
* @help
* Galv's Event Detectors
* ----------------------------------------------------------------------------
* This is a basic event detection plugin. It can allow events to detect the
* player within a certain range and within line of sight.
* Line of sight is 180 degrees in the event's front arc. Regions, terrain tags
* or events can be set to block line of sight to the player.
* Region Id's and terrain tag Id's are set using the plugin settings. To make
* an event block line of sight, you need to use a COMMENT inside an event
* page that has a text tag as follows:
*
* <block_los>
*
* An event that has an active page with this tag will block line of sight. If
* the page is changed to one without the tag, it will not block LOS.
*
* ----------------------------------------------------------------------------
*
* ----------------------------------------------------------------------------
* Conditional Branch SCRIPT
* ----------------------------------------------------------------------------
* You can use the below script call to check if an event can detect the player
* at the time the conditional branch is called. (Yes this can be used in a
* parallel process event if required)
*
* Galv.DETECT.event(id,dist,los) // id = event ID that is a detector
* // dist = tile distance from player
* // los = true or false for line of sight
*
* This will return true if the player is in distance range of the event and
* if los is true, it will also check if player is in line of sight to it.
* ----------------------------------------------------------------------------
*
* ----------------------------------------------------------------------------
* Event command SCRIPT
* ----------------------------------------------------------------------------
* $gameSystem._undetectable = x; // x can be true or false. When true
* // player cannot be detected
* ----------------------------------------------------------------------------
*
* ----------------------------------------------------------------------------
* Behaviors
* ----------------------------------------------------------------------------
* Behaviors can be used to set up an event's reaction from within the custom
* 'Autonomous Movement' settings of the event. The plugin settings has many
* behaviors you can set up with the following settings:
*
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
*
* moveTypes can be one of the following:
* approach, flee, search, freeze, rand, return
* approach - event moves toward player, no pathfinding
* flee - event moves away from player
* search - event moves toward player's last detected position with
* - default rpgmaker pathfinding. The 'search limit' sets
* - how far an event will find its way to player or return
* freeze - event doesn't move
* rand - event moves randomly
* return - event saves it's original position and returns to this
* position when not detecting the player.
* dist = distance in number of tiles from the event that it can detect
* los = 0 or 1... 1 to use line of sight or 0 to not for detecting
* speed = the change of move speed while detecting (1-6)
* freq = the change of move frequency while detecting (1-5)
* balloon = the balloon id to show when event detects player
*
* HOW TO USE
* To set an event to follow a behavior, you need to use a 'SCRIPT' command
* inside of a custom Autonomous Move Route as follows:
*
* this.detector(id);
*
* This will use the chosen Behavior id (from the numbers in the plugin setup).
* The 'moveTypeBefore' selection above and the event page's speed and freq
* control the event's default movement when not detecting.
*
* See demo for examples
*/
//-----------------------------------------------------------------------------
// CODE STUFFS
//-----------------------------------------------------------------------------
(function() {
// Blocking terrain tag array
var tmp = PluginManager.parameters('Galv_EventDetectors')["LOS Blocking Terrain"].split(",");
Galv.DETECT.bTerrain = [];
if (tmp && tmp[0]) {
for (var i = 0; i < tmp.length; i++) {
Galv.DETECT.bTerrain.push(Number(tmp[i]));
};
};
// Blocking regions array
tmp = PluginManager.parameters('Galv_EventDetectors')["LOS Blocking Regions"].split(",");
Galv.DETECT.bRegions = [];
if (tmp || tmp[0]) {
for (var i = 0; i < tmp.length; i++) {
Galv.DETECT.bRegions.push(Number(tmp[i]));
};
};
// tile size
Galv.DETECT.tile = Number(PluginManager.parameters('Galv_EventDetectors')["Tile Size"]);
Galv.DETECT.searches = Number(PluginManager.parameters('Galv_EventDetectors')["Search Limit"]);
// Behaviors
Galv.DETECT.behaviors = {};
var i = 0;
do {
tmp = PluginManager.parameters('Galv_EventDetectors')["Behavior " + i];
if (tmp) {
Galv.DETECT.behaviors[i] = tmp.split(",");
for (var i2 = 2; i2 < Galv.DETECT.behaviors[i].length; i2++) {
Galv.DETECT.behaviors[i][i2] = Number(Galv.DETECT.behaviors[i][i2]);
};
};
i++;
}
while (tmp);
Galv.DETECT.event = function(id,dist,los) {
if ($gameSystem._undetectable) return false;
return $gameMap.event(id).distDetect(dist,los);
};
Galv.DETECT.dist = function(x1,y1,x2,y2) {
return Math.sqrt(Math.pow(x1 - x2,2) + Math.pow(y1 - y2,2));
};
Galv.DETECT.isBlock = function(x,y) {
var x = Math.round(x);
var y = Math.round(y);
if (Galv.DETECT.bRegions.contains($gameMap.regionId(x,y))) return true;
if (Galv.DETECT.bTerrain.contains($gameMap.terrainTag(x,y))) return true;
// Blocking event
var blockEvent = false;
$gameMap.eventsXy(x, y).forEach(function(event) {
if (event._blockLos) return blockEvent = true;
});
return blockEvent;
};
Galv.DETECT.los = function(char1,char2) {
var a = {x:char1.x, y:char1.y};
var b = {x:char2.x, y:char2.y};
// If in front
switch (char2._direction) {
case 2:
if (b.y > a.y) return false;
break;
case 4:
if (b.x < a.x) return false;
break;
case 6:
if (b.x > a.x) return false;
break;
case 8:
if (b.y < a.y) return false;
break;
default:
};
// Direct Line
if (Math.abs(a.x - b.x) >= Math.abs(a.y - b.y)) {
// h slope
if (a.x == b.x) {
var slope = null;
var int = a.x;
} else {
var slope = (a.y - b.y) / (a.x - b.x);
var int = a.y - slope * a.x;
};
for (var x = a.x; x <= b.x; x++) {
var y = slope * x + int;
if (Galv.DETECT.isBlock(x,y)) return false;
}
for (var x = a.x; x >= b.x; x--) {
var y = slope * x + int;
if (Galv.DETECT.isBlock(x,y)) return false;
}
} else if (Math.abs(a.y - b.y) >= Math.abs(a.x - b.x)) {
// v slope
if (a.y == b.y) {
var slope = null;
var int = a.y;
} else {
var slope = (a.x - b.x) / (a.y - b.y);
var int = a.x - slope * a.y;
};
for (var y = a.y; y <= b.y; y++) {
var x = slope * y + int;
if (Galv.DETECT.isBlock(x,y)) return false;
}
for (var y = a.y; y >= b.y; y--) {
var x = slope * y + int;
if (Galv.DETECT.isBlock(x,y)) return false;
}
};
return true;
};
Game_Character.prototype.searchLimit = function() {
return Galv.DETECT.searches;
};
// GAME CHARACTER
//-----------------------------------------------------------------------------
Galv.DETECT.Game_Character_initMembers = Game_Character.prototype.initMembers;
Game_Character.prototype.initMembers = function() {
this.setDetectVars();
Galv.DETECT.Game_Character_initMembers.call(this);
};
Game_Character.prototype.distDetect = function(range,los,id,balloon) {
var balloon = balloon || 0;
var id = id || 0;
var range = range * Galv.DETECT.tile;
var target = id > 0 ? $gameMap.event(id) : $gamePlayer;
var x1 = this.screenX();
var y1 = this.screenY();
var x2 = target.screenX();
var y2 = target.screenY();
var dist = Galv.DETECT.dist(x1,y1,x2,y2);
if (dist <= range) { // If in radius range of target
if ((los && Galv.DETECT.los(target,this)) || !los) { // If LOS to target is not blocked
this._dTarget = {x:target.x,y:target.y}; // Set target x,y each step when detected so if los is broken, event still moves to last seen x,y
this.doDetected(id);
return true;
};
};
this.doUndetected(id);
return false;
};
Game_Character.prototype.isDetecting = function(id) {
return id ? this._detecting.contains(id) : this._detecting.length > 0;
};
Game_Character.prototype.doDetected = function(id) {
if (!this._detecting.contains(id)) {
this._detecting.push(id);
if (!this._searchXY[0]) this._balloonId = this._detectBalloon;
};
};
Game_Character.prototype.doUndetected = function(id) {
var index = this._detecting.indexOf(id);
if (index > -1) this._detecting.splice(index,1);
};
Game_Character.prototype.detector = function(id) {
if ($gameSystem._undetectable) return;
this._detectBalloon = Galv.DETECT.behaviors[id][6];
var detected = this.distDetect(Galv.DETECT.behaviors[id][2],Galv.DETECT.behaviors[id][3]);
if (detected) {
this.doDetectMove(id,1); // do detected movement
} else {
if (this._searchXY[0]) {
// do move toward last x,y position detected at
this.moveTowardLastDetect();
} else {
this.doDetectMove(id,0); // do original movement
};
};
};
Game_Character.prototype.doDetectMove = function(id,type) {
//type 1 = detect move
//type 0 = after detect move
if (type == 0) {
this._moveSpeed = this._origMovement._moveSpeed;
this._moveFrequency = this._origMovement._moveFrequency;
} else {
this._moveSpeed = Galv.DETECT.behaviors[id][4];
this._moveFrequency = Galv.DETECT.behaviors[id][5];
};
switch (Galv.DETECT.behaviors[id][type]) {
case 'approach':
this.moveTowardPlayer();
break;
case 'flee':
this.moveAwayFromPlayer();
break;
case 'search':
if (this._detectPause <= 0) {
this._moveFrequency = 5;
this._searchXY = [$gamePlayer.x,$gamePlayer.y]; // get last detected x,y coords
this.moveTowardLastDetect();
this._detectPause = 30 * (5 - this._origMovement._moveFrequency) + 3;
};
this._detectPause -= 1;
break;
case 'rand':
if (this._detectPause <= 0) {
this._moveFrequency = 5;
this.moveRandom();
this._detectPause = 30 * (5 - this._origMovement._moveFrequency) + 1;
};
this._detectPause -= 1;
break;
case 'return':
this._moveFrequency = 5;
this.returnToSavedXY(); // move to original position
case 'freeze':
default:
this.resetStopCount();
};
};
Game_CharacterBase.prototype.returnToSavedXY = function() {
if (this.x != this._origMovement.x || this.y != this._origMovement.y) {
direction = this.findDirectionTo(this._origMovement.x,this._origMovement.y);
if (direction > 0) {
this.moveStraight(direction);
}
} else {
this._direction = this._origMovement._direction;
this.resetStopCount();
};
};
Game_Character.prototype.setDetectVars = function() {
this._detecting = [];
this._searchXY = [];
this._detectPause = 0;
this._detectPauseTime = 40;
this._origMovement = {'_moveFrequency':this._moveFrequency,'_moveSpeed':this._moveSpeed,'x':0,'y':0};
this.searchActions = [
'turnRight90',
'turnLeft90',
'turnLeft90',
'turnRight90',
];
this.searchActions.reverse();
};
Game_Character.prototype.moveTowardLastDetect = function() {
if (!this._searchXY[0]) {
this._searchXY = [];
this.resetStopCount();
} else if (this._searchXY[0] == this.x && this._searchXY[1] == this.y) {
if (this._searchTurnIndex > -1) {
this[this.searchActions[this._searchTurnIndex]](); // run corresponding action
// set searchXY to destination in case search actions move it
this._searchXY[0] = this.x;
this._searchXY[1] = this.y;
this._searchTurnIndex -= 1;
this._waitCount = 20;
} else {
this._searchXY = [];
this.resetStopCount();
}
} else {
this._searchTurnIndex = this.searchActions.length - 1;
var direction = this.findDirectionTo(this._searchXY[0],this._searchXY[1]);
if (direction > 0) {
this.moveStraight(direction);
}
};
};
// GAME EVENT
//-----------------------------------------------------------------------------
Galv.DETECT.Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
Game_Event.prototype.setupPageSettings = function() {
Galv.DETECT.Game_Event_setupPageSettings.call(this);
this.setDetectStuff();
};
Game_Event.prototype.setDetectStuff = function() {
this._detectBalloon = 0;
var page = this.page();
this._blockLos = false;
if (page) {
for (var i = 0; i < page.list.length; i++) {
if (page.list[i].code == 108 && page.list[i].parameters[0].contains("<block_los>")) {
this._blockLos = true;
break;
};
};
this._origMovement._moveSpeed = page.moveSpeed;
this._origMovement._moveFrequency = page.moveFrequency;
this._origMovement._direction = this._direction;
this._origMovement.x = this.x;
this._origMovement.y = this.y;
};
};
})();

View file

@ -0,0 +1,271 @@
//-----------------------------------------------------------------------------
// Galv's Move Route Extras
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_MoveRouteExtras.js
//-----------------------------------------------------------------------------
// 2015-11-05 - Version 1.1 - added ability to change graphic to a frame
// 2015-10-23 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_MoveRouteExtras = true;
var Galv = Galv || {}; // Galv's main object
Galv.MRE = Galv.MRE || {}; // Galv's Move Route Extra's stuff
//-----------------------------------------------------------------------------
/*:
* @plugindesc Additional SCRIPT commands to use within MOVE ROUTES
* View the plugin "Help" to view available commands.
* @author Galv - galvs-scripts.com
* @help
* Galv's Move Route Extras
* ----------------------------------------------------------------------------
* This script enables users to use commands in the 'script' function of
* MOVE ROUTES. The available commands are listed below.
*
* ----------------------------------------------------------------------------
* SCRIPT calls for MOVE ROUTES
* ----------------------------------------------------------------------------
* this.jump_forward(x); // Jump forward x tiles
* this.jump_to(x,y); // Jump to x,y co-ordinates on the map
* this.jump_to(i); // Jump to character's x,y location
* // i = event id. Make it 0 for player
* this.step_toward(x,y); // Step toward x,y co-ordinates on the map
* this.step_toward(i); // Step toward a character's x,y location
* // i = event id. 0 works for player, too
* this.step_away(x,y); // Step away from x,y co-ordinates on the map
* this.step_away(i); // Step away from a character's x,y location
* // i = event id. 0 works for player, too
* this.turn_toward(x,y); // Face toward x,y co-ordinates on the map
* this.turn_toward(i); // Face toward a character's x,y location
* // i = event id. 0 works for player, too
* this.turn_away(x,y); // Turn away from x,y map co-ordinates
* this.turn_away(i); // Turn away from a character's x,y location
* // i = event id. 0 works for player, too
* this.sswitch("n",status); // Change self switch "n" to status true/false
* this.rwait(low,high); // wait a random time between low and high
*
* this.fade(s); // s is the fade speed.
* // Positive fades in, Negative fades out.
* this.step_rand(id,id,id); // Move randomly only on specified region id's
* // Multiple id's can be used, comma separated
* this.repeat_begin(n); // Repeat the next move commands between this..
* this.repeat_end(); // and repeat_end n number of times
*
* this.set_frame("name",index,pattern,direction) // set graphic to a frame
*
* // "name" - is the characterset file name
* // index - the number of the character in the characterset (1-8)
* // pattern - the stepping frame (1-3)
* // direction - the direction the event is facing (2,4,6,8)
* // Once a character has been set to a frame, it wont change when moving
* // until you restore the character using the below move route script:
*
* this.restore_frame() // unlocks the frame chosen in set_frame
*
*
* // Below are a couple of useful codes that work without this script
* this.requestBalloon(n); // Displays the balloon that has id of n
* this.requestAnimation(n); // Displays animation that has id of n
*
* ----------------------------------------------------------------------------
* EXAMPLES OF USE
* ----------------------------------------------------------------------------
* this.jump_forward(3); // Jumps 3 tiles the direction character faces
* this.jump_to(5); // Jump to event 5's position
* this.jump_to(10,16); // Jump to x10, y15
* this.step_toward(3); // Takes a step toward event 3's position
* this.step_away(12,8); // Takes a step away from x12, y8 co-ordinates
* this.sswitch("A",true); // Turns self switch "A" ON for event
* this.sswitch("B",false); // Turns self switch "B" OFF for event
* this.rwait(60,120); // Waits randomly between 60 and 120 frames
* this.fade(-10); // Fades out character
* this.step_rand(1,4,7); // Take a step randomly, only on regions 1,4,7
* this.requestAnimation(2); // Shows animation 2 on character
* ----------------------------------------------------------------------------
*/
//-----------------------------------------------------------------------------
// CODE STUFFS
//-----------------------------------------------------------------------------
(function() {
Game_Character.prototype.repeat_times = 0;
Game_Character.prototype.repeat_start_index = 0;
// REPEATING COMMANDS
Game_Character.prototype.repeat_begin = function(times) {
this.repeats = times - 1;
this.repeat_start_index = this._moveRouteIndex;
};
Game_Character.prototype.repeat_end = function() {
if (this.repeats > 0) {
this._moveRouteIndex = this.repeat_start_index;
this.repeats -= 1;
};
};
// FADING
Game_Character.prototype.fade = function(speed) {
// Change opacity
this.setOpacity(this.opacity() + speed);
// Repeat until finished
if (speed > 0 && this.opacity() < 255) {
this._moveRouteIndex -= 1;
} else if (speed < 0 && this.opacity() > 0) {
this._moveRouteIndex -= 1;
};
};
// JUMP FORWARD
Game_Character.prototype.jump_forward = function(count) {
var sx = 0, sy = 0;
switch (this.direction()) {
case 2:
sy = count;
break;
case 4:
sx = -count;
break;
case 6:
sx = count;
break;
case 8:
sy = -count;
break;
};
this.jump(sx,sy);
};
// JUMP TO
Game_Character.prototype.jump_to = function() {
var sx = 0, sy = 0;
if (arguments.length > 1) {
// x,y coords
sx = this.x - arguments[0];
sy = this.y - arguments[1];
} else if (arguments.length === 1) {
// Character ID
if (arguments[0] === 0) {
// Is player
sx = this.x - $gamePlayer.x;
sy = this.y - $gamePlayer.y;
} else {
// Is event
sx = this.x - $gameMap._events[arguments[0]].x;
sy = this.y - $gameMap._events[arguments[0]].y;
};
};
this.jump(-sx,-sy);
};
// STEP TOWARD
Game_Character.prototype.step_toward = function() {
var char = Galv.MRE.getMrChar(arguments);
if (char) this.moveTowardCharacter(char);
};
// STEP AWAY
Game_Character.prototype.step_away = function() {
var char = Galv.MRE.getMrChar(arguments);
if (char) this.moveAwayFromCharacter(char);
};
// TURN TOWARD
Game_Character.prototype.turn_toward = function() {
var char = Galv.MRE.getMrChar(arguments);
if (char) this.turnTowardCharacter(char);
};
Game_Character.prototype.turn_away = function() {
var char = Galv.MRE.getMrChar(arguments);
if (char) this.turnAwayFromCharacter(char);
};
// GET MR CHARACTER
Galv.MRE.getMrChar = function(arguments) {
var char = null;
if (arguments.length > 1) {
// Move toward x,y
char = { x : arguments[0], y : arguments[1] };
} else if (arguments.length === 1) {
if (arguments[0] === 0) {
// Is player
char = $gamePlayer;
} else {
// Is event
char = $gameMap._events[arguments[0]];
};
};
return char;
};
// SELF SWITCHES
Game_Character.prototype.sswitch = function(letter,status,eid,mapid) {
var key = [mapid || $gameMap.mapId(), eid || this.eventId(), letter];
$gameSelfSwitches.setValue(key, status);
};
// RANDOM WAIT
Game_Character.prototype.rwait = function(low,high) {
this._waitCount = Math.randomInt(high - low) + low;
};
// MOVE RANDOM ON REGION
Game_Character.prototype.step_rand = function() {
var d = 2 + Math.randomInt(4) * 2;
// If region is not there, return false.
var x2 = $gameMap.roundXWithDirection(this.x, d);
var y2 = $gameMap.roundYWithDirection(this.y, d);
var region_test = false;
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] === $gameMap.regionId(x2, y2)) {
region_test = true;
break;
};
};
if (!region_test) return false;
if (!$gameMap.isValid(x2, y2)) return false;
if (this.canPass(this.x, this.y, d)) {
this.moveStraight(d);
};
};
// SET TO CHARACTER FRAME
Game_Character.prototype.set_frame = function(name,index,pattern,direction) {
this.gstop = true;
this._direction = direction;
this._pattern = pattern - 1;
this._characterName = name !== "" ? name : this._characterName;
this._characterIndex = index - 1;
};
// RESTORE CHAR ANIMATION
Game_Character.prototype.restore_frame = function() {
this.gstop = false;
};
// MOD
var Galv_Game_CharacterBase_updatePattern = Game_CharacterBase.prototype.updatePattern;
Game_CharacterBase.prototype.updatePattern = function() {
if (this.gstop) return;
Galv_Game_CharacterBase_updatePattern.call(this);
};
})();

View file

@ -0,0 +1,193 @@
//=============================================================================
// Gamefall Team Plugins - Optimization for Omori taking in account
// YEP_Core Updates;
// GTP_CoreUpdates.js VERSION 1.0.1
//=============================================================================
var Imported = Imported || {};
Imported.GTP_CoreUpdates = true;
var Gamefall = Gamefall || {};
Gamefall.CoreUpdates = Gamefall.CoreUpdates || {};
//=============================================================================
/*:
* @plugindesc v1.0.1 Optimization for Omori taking in account YEP Core Updates
* @author Gamefall Team || Luca Mastroianni
* @help
* CHANGELOG:
* VERSION 1.0.0: Plugin Released!
* VERSION 1.0.1: Reduced lag filtering events;
*/
//=============================================================================
(function ($) {
// Replaced ForEach
Sprite.prototype.update = function () {
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (!child) { continue; }
if (child && child.update) child.update();
};
};
// Replaced ForEach
Tilemap.prototype.update = function () {
this.animationCount++;
this.animationFrame = Math.floor(this.animationCount / 30);
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (!child) { continue; }
if (child && child.update) child.update();
}
var length = this.bitmaps.length;
for (var i = 0; i < length; ++i) {
if (this.bitmaps[i]) this.bitmaps[i].touch();
}
};
// Replaced ForEach
TilingSprite.prototype.update = function () {
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (child && child.update) child.update();
}
};
// Replaced ForEach
Window.prototype.update = function () {
if (this.active) this._animationCount++;
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (child && child.update) child.update();
}
};
// Replaced ForEach
WindowLayer.prototype.update = function () {
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (child && child.update) child.update();
}
};
// Replaced ForEach
Weather.prototype._updateAllSprites = function () {
var maxSprites = Math.floor(this.power * 10);
while (this._sprites.length < maxSprites) {
this._addSprite();
}
while (this._sprites.length > maxSprites) {
this._removeSprite();
}
var length = this._sprites.length;
for (var i = 0; i < length; ++i) {
var sprite = this._sprites[i];
this._updateSprite(sprite);
sprite.x = sprite.ax - this.origin.x;
sprite.y = sprite.ay - this.origin.y;
}
};
Game_Interpreter.prototype.setup = function (list, eventId) {
this.clear();
this._mapId = $gameMap.mapId();
this._eventId = eventId || 0;
this._list = list;
};
// Change Tileset Event: load instead of reserve
Game_Interpreter.prototype.command282 = function () {
var tileset = $dataTilesets[this._params[0]];
for (var i = 0; i < tileset.tilesetNames.length; i++) {
ImageManager.loadTileset(tileset.tilesetNames[i]);
}
if (ImageManager.isReady()) {
$gameMap.changeTileset(this._params[0]);
return true;
} else {
return false;
}
};
// Ready preparation now refers to fully loaded instead of reservation
Sprite_Animation.prototype.isReady = function () {
return ImageManager.isReady();
};
// Replaced ForEach
Sprite_Animation.prototype.updateFrame = function () {
if (this._duration > 0) {
var frameIndex = this.currentFrameIndex();
this.updateAllCellSprites(this._animation.frames[frameIndex]);
var length = this._animation.timings.length;
for (var i = 0; i < length; ++i) {
var timing = this._animation.timings[i];
if (timing.frame === frameIndex) this.processTimingData(timing);
};
}
};
// Cleaning algorithm up
Sprite_Animation.prototype.updateCellSprite = function (sprite, cell) {
var pattern = cell[0];
if (pattern >= 0) {
var sx = pattern % 5 * 192;
var sy = Math.floor(pattern % 100 / 5) * 192;
var mirror = this._mirror;
sprite.bitmap = pattern < 100 ? this._bitmap1 : this._bitmap2;
sprite.setFrame(sx, sy, 192, 192);
sprite.x = cell[1];
sprite.y = cell[2];
if (this._mirror) {
sprite.x *= -1;
}
sprite.rotation = cell[4] * Math.PI / 180;
sprite.scale.x = cell[3] / 100;
if ((cell[5] && !mirror) || (!cell[5] && mirror)) {
sprite.scale.x *= -1;
}
sprite.scale.y = cell[3] / 100;
sprite.opacity = cell[6];
sprite.blendMode = cell[7];
sprite.visible = true;
} else {
sprite.visible = false;
}
};
Scene_Base.prototype.updateChildren = function () {
var length = this.children.length;
for (var i = 0; i < length; ++i) {
var child = this.children[i];
if (!child) { continue; }
if (child.update) child.update();
}
};
Scene_Boot.prototype.isGameFontLoaded = function () {
if (Graphics.isFontLoaded('GameFont')) {
return true;
} else {
var elapsed = Date.now() - this._startDate;
if (elapsed >= 60000) {
throw new Error('Failed to load GameFont');
}
}
};
Game_Map.prototype.eventsXy = function (x, y) {
return this._events.filter(event => { return !!event && event.pos(x, y) })
}
Game_Map.prototype.eventsXyNt = function (x, y) {
return this._events.filter(event => { return !!event && event.posNt(x, y) })
}
})(Gamefall.CoreUpdates);

File diff suppressed because it is too large Load diff

578
www.eng/js/plugins/Gacha.js Normal file
View file

@ -0,0 +1,578 @@
//=============================================================================
// Gacha.js
//
// (c)2016 KADOKAWA CORPORATION./YOJI OJIMA
//=============================================================================
/*:
* @plugindesc Get the item at random
* @author Takeya Kimura
*
* @param Help Message Text
* @desc The help message for gacha window. "Required Amount" is replaced with the Required Amount.
* @default 1回Required Amount\Gでガチャを引きます
*
* @param Button Text
* @desc The button text for gacha commands.
* @default ガチャを引く
*
* @param Get Message Text
* @desc The message of After receiving. "Item Name" is replaced with the received item name.
* @default GET Item Name
*
* @param Show Item Description
* @desc The switch of item description display
* @default 0
*
* @param Effect
* @desc The animation number for get effect.
* @default 119
* @require 1
* @type animation
*
* @param Rank1 Effect
* @desc The animation number for rank 1 effect. If you specify -1, does not display the animation.
* @default -1
* @require 1
* @type animation
*
* @param Rank2 Effect
* @desc The animation number for rank 2 effect. If you specify -1, does not display the animation.
* @default -1
* @require 1
* @type animation
*
* @param Rank3 Effect
* @desc The animation number for rank 3 effect. If you specify -1, does not display the animation.
* @default -1
* @require 1
* @type animation
*
* @param Rank4 Effect
* @desc The animation number for rank 4 effect. If you specify -1, does not display the animation.
* @default -1
* @require 1
* @type animation
*
* @param Rank5 Effect
* @desc The animation number for rank 5 effect. If you specify -1, does not display the animation.
* @default -1
* @require 1
* @type animation
*
* @param ME
* @desc The ME name for get music effect.
* @default Organ
* @require 1
* @dir audio/me/
* @type file
*
* @param Required Amount
* @desc The Gold for gacha.
* @default 100
*
* @noteParam gachaImage
* @noteRequire 1
* @noteDir img/gacha/
* @noteType file
* @noteData items
*
* @help
*
* Plugin Command:
* Gacha open # Open the Gacha screen
* Gacha add item 1 # Add item #1 to the Gacha
* Gacha remove item 1 # Remove item #1 from the Gacha
* Gacha clear # Clear the Gacha
*
*
* Item Note:
* <gachaImage:image> # Gacha image file name. Please image put in "img/gacha/" folder.
* <gachaNumLot:10> # The number of the lottery.
* <gachaRank:5> # The rank of the item(1-5).
*/
/*:ja
* @plugindesc ランダムにアイテムを取得します
* @author Takeya Kimura
*
* @param Help Message Text
* @desc ガチャ画面のヘルプメッセージですRequired Amountは消費Gと置換されます
* @default 1回Required Amount\Gでガチャを引きます
*
* @param Button Text
* @desc ガチャボタンに表示するテキストです
* @default ガチャを引く
*
* @param Get Message Text
* @desc ガチャを引いた後のメッセージですItem Nameは取得アイテム名と置換されます
* @default GET Item Name
*
* @param Show Item Description
* @desc 1でアイテム取得時に説明を表示します[0: 説明非表示 1: 説明表示]
* @default 0
*
* @param Effect
* @desc アイテム取得時のアニメーションIDを指定します
* @default 119
* @require 1
* @type animation
*
* @param Rank1 Effect
* @desc ランク1の時のアニメーションIDを指定します-1を指定するとアニメーションを表示しません
* @default -1
* @require 1
* @type animation
*
* @param Rank2 Effect
* @desc ランク2の時のアニメーションIDを指定します-1を指定するとアニメーションを表示しません
* @default -1
* @require 1
* @type animation
*
* @param Rank3 Effect
* @desc ランク3の時のアニメーションIDを指定します-1を指定するとアニメーションを表示しません
* @default -1
* @require 1
* @type animation
*
* @param Rank4 Effect
* @desc ランク4の時のアニメーションIDを指定します-1を指定するとアニメーションを表示しません
* @default -1
* @require 1
* @type animation
*
* @param Rank5 Effect
* @desc ランク5の時のアニメーションIDを指定します-1を指定するとアニメーションを表示しません
* @default -1
* @require 1
* @type animation
*
* @param ME
* @desc アイテム取得時のMEを指定します
* @default Organ
* @require 1
* @dir audio/me/
* @type file
*
* @param Required Amount
* @desc ガチャを引くのに必要なGです
* @default 100
*
* @noteParam gachaImage
* @noteRequire 1
* @noteDir img/gacha/
* @noteType file
* @noteData items
*
* @help
*
* Plugin Command:
* Gacha open # ガチャ画面を開きます
* Gacha add item 1 # アイテム番号1をガチャ対象に追加します
* Gacha remove item 1 # アイテム番号1をガチャ対象から外します
* Gacha clear # 全てのガチャ対象をクリアします
*
*
* Item Note:
* <gachaImage:image> # ガチャアイテムの画像を指定します画像はimg/gacha/フォルダ内に入れてください
* <gachaNumLot:10> # ガチャアイテムのくじ数を指定します
* <gachaRank:5> # ガチャアイテムのランクを1から5の間で指定します
*/
(function () {
var parameters = PluginManager.parameters('Gacha');
var message;
var itemDescEnable = !!Number(parameters['Show Item Description'] || 0);
var rankEffect = [];
rankEffect.push(Number(parameters['Rank1 Effect'] || '-1'));
rankEffect.push(Number(parameters['Rank2 Effect'] || '-1'));
rankEffect.push(Number(parameters['Rank3 Effect'] || '-1'));
rankEffect.push(Number(parameters['Rank4 Effect'] || '-1'));
rankEffect.push(Number(parameters['Rank5 Effect'] || '-1'));
var me = String(parameters['ME'] || 'Organ');
var amount = Number(parameters['Required Amount'] || '100');
var reg = /Required Amount/gi;
Scene_Boot = class extends Scene_Boot {
start() {
super.start();
message = LanguageManager.getMessageData("gacha_minigame.message_0").text;
message = message.replace(reg, String(amount));
}
}
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === "Gacha") {
switch (args[0]) {
case "open":
SceneManager.push(Scene_Gacha);
break;
case 'add':
$gameSystem.addToGacha(args[1], Number(args[2]));
break;
case 'remove':
$gameSystem.removeFromGacha(args[1], Number(args[2]));
break;
case 'clear':
$gameSystem.clearGacha();
break;
}
}
};
// YIN
Game_Interpreter.prototype.initGacha = function() {
ImageManager.loadAtlas("gacha_prizes");
// INIT GACHA
this._gachaItem = null;
this._gachaLot = [];
this._rankSprite = new Sprite_GachaEffect();
this._rankSprite.keepDisplay(true);
SceneManager._scene.addChild(this._rankSprite);
var wy = 120;
var wh = 320;
this._getWindow = new Window_GachaGet(0, wy, 280, wh);
this._getWindow.itemDescEnable(itemDescEnable);
this._getWindow.hide();
SceneManager._scene.addWindow(this._getWindow);
var numLot;
var item, i, j;
for (i = 1; i < $dataItems.length; i++) {
item = $dataItems[i];
if ($gameSystem.isInGacha(item)) {
numLot = Number(item.meta.gachaNumLot || '0');
for (j = 0; j < numLot; j++) {
this._gachaLot.push(item);
}
}
}
for (i = 1; i < $dataWeapons.length; i++) {
item = $dataWeapons[i];
if ($gameSystem.isInGacha(item)) {
numLot = Number(item.meta.gachaNumLot || '0');
for (j = 0; j < numLot; j++) {
this._gachaLot.push(item);
}
}
}
for (i = 1; i < $dataArmors.length; i++) {
item = $dataArmors[i];
if ($gameSystem.isInGacha(item)) {
numLot = Number(item.meta.gachaNumLot || '0');
for (j = 0; j < numLot; j++) {
this._gachaLot.push(item);
}
}
}
this._gachaItem = this._gachaLot[(Math.random() * this._gachaLot.length) >> 0];
this._getWindow.setItem(this._gachaItem);
$gameParty.gainItem(this._gachaItem, 1);
}
// YIN
Game_Interpreter.prototype.displayGachaItem = function(item) {
this._getWindow._gachaSprite.opacity = 0;
this._moveGet = true;
this._getWindow.x = (Graphics.boxWidth - this._getWindow.width) / 2;
this._getWindow.y = 120;
this._getWindow.show();
}
// YIN
Game_Interpreter.prototype.removeGachaWindow = function() {
this._gachaClosing = true;
}
var yin_Interpreter_Update = Game_Interpreter.prototype.update;
Game_Interpreter.prototype.update = function () {
yin_Interpreter_Update.call(this);
if (this._gachaClosing) {
this._getWindow._gachaSprite.opacity -= 20;
this._rankSprite.opacity -= 28;
if (this._getWindow._gachaSprite.opacity <= 0) {
this._getWindow.close();
this._gachaItem = null;
this._gachaLot = [];
this._rankSprite.allRemove();
SceneManager._scene.removeChild(this._rankSprite);
SceneManager._scene.removeChild(this._getWindow);
this._getWindow = null;
this._rankSprite = null;
this._moveGet = null;
this._gachaClosing = null;
}
}
if (this._getWindow && this._getWindow._gachaSprite.opacity < 255 && this._moveGet) {
this._getWindow._gachaSprite.opacity += 4;
this._getWindow.y -= 5;
if (this._getWindow.y <= 32) {
this._getWindow.y = 32;
}
if (this._getWindow._gachaSprite.opacity >= 255) {
this._getWindow._gachaSprite.opacity = 255;
}
if (this._getWindow._gachaSprite.opacity === 255 && this._getWindow.y === 32) {
this._moveGet = false;
}
}
}
Game_System.prototype.addToGacha = function(type, dataId) {
if (!this._GachaFlags) {
this.clearGacha();
}
var typeIndex = this.gachaTypeToIndex(type);
if (typeIndex >= 0) {
this._GachaFlags[typeIndex][dataId] = true;
}
};
Game_System.prototype.removeFromGacha = function(type, dataId) {
if (this._GachaFlags) {
var typeIndex = this.gachaTypeToIndex(type);
if (typeIndex >= 0) {
this._GachaFlags[typeIndex][dataId] = false;
}
}
};
Game_System.prototype.gachaTypeToIndex = function(type) {
switch (type) {
case 'item':
return 0;
case 'weapon':
return 1;
case 'armor':
return 2;
default:
return -1;
}
};
Game_System.prototype.clearGacha = function() {
this._GachaFlags = [[], [], []];
};
Game_System.prototype.isInGacha = function(item) {
if (this._GachaFlags && item) {
var typeIndex = -1;
if (DataManager.isItem(item)) {
typeIndex = 0;
} else if (DataManager.isWeapon(item)) {
typeIndex = 1;
} else if (DataManager.isArmor(item)) {
typeIndex = 2;
}
if (typeIndex >= 0) {
return !!this._GachaFlags[typeIndex][item.id];
} else {
return false;
}
} else {
return false;
}
};
function Window_GachaGet() {
this.initialize.apply(this, arguments);
}
Window_GachaGet.prototype = Object.create(Window_Base.prototype);
Window_GachaGet.prototype.constructor = Window_GachaGet;
Window_GachaGet.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.opacity = 0;
this._item = null;
this._itemDescEnable = true;
this._gachaSprite = new Sprite();
this._gachaSprite.anchor.x = 0.5;
this._gachaSprite.anchor.y = 0.5; // bottom
this._gachaSprite.x = width / 2;
this._gachaSprite.y = Graphics.boxHeight - height - this._gachaSprite.height - this.standardPadding();
this._gachaSprite.opacity = 0;
this.addChildToBack(this._gachaSprite);
this.refresh();
};
Window_GachaGet.prototype.isUsingCustomCursorRectSprite = function () { return true; };
Window_GachaGet.prototype.itemDescEnable = function(value) {
if (this._itemDescEnable !== value) {
this._itemDescEnable = value;
this.refresh();
}
};
Window_GachaGet.prototype.setItem = function(item) {
if (this._item !== item) {
this._item = item;
this.refresh();
}
};
Window_GachaGet.prototype.update = function() {
Window_Base.prototype.update.call(this);
if (this._gachaSprite.bitmap) {
var bitmapHeight = this._gachaSprite.bitmap.height;
var contentsHeight = this.contents.height;
if (this._itemDescEnable) {
contentsHeight -= this.lineHeight() * 3
}
var scale = 1;
if (bitmapHeight > contentsHeight) {
scale = contentsHeight / bitmapHeight;
}
this._gachaSprite.scale.x = scale;
this._gachaSprite.scale.y = scale;
}
};
Window_GachaGet.prototype.refresh = function() {
var item = this._item;
this.contents.clear();
if (this._itemDescEnable) {
var y = this.contentsHeight() - this.lineHeight() * 3;
this.drawHorzLine(y);
this.drawDescription(0, y + this.lineHeight());
}
if (!item || !item.meta.gachaImage) {
this._gachaSprite.bitmap = null;
return;
}
else {
var bitmap;
bitmap = ImageManager.loadPicture(this._item.meta.gachaImage);
this._gachaSprite.bitmap = bitmap;
bitmap.smooth = true;
if ([83,90,91,92,93].contains(this._item.id)) {
this._gachaSprite.y = this._gachaSprite.y - 32;
}
}
};
Window_GachaGet.prototype.drawDescription = function(x, y) {
if (this._item) this.drawTextEx(this._item.description, x, y);
};
Window_GachaGet.prototype.drawHorzLine = function(y) {
var lineY = y + this.lineHeight() / 2 - 1;
this.contents.paintOpacity = 48;
this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.lineColor());
this.contents.paintOpacity = 255;
};
Window_GachaGet.prototype.lineColor = function() {
return this.normalColor();
};
function Sprite_GachaEffect() {
this.initialize.apply(this, arguments);
}
Sprite_GachaEffect.prototype = Object.create(Sprite.prototype);
Sprite_GachaEffect.prototype.constructor = Sprite_GachaEffect;
Sprite_GachaEffect.prototype.initialize = function() {
Sprite.prototype.initialize.call(this);
this._animationSprites = [];
this._endSprites = [];
this._effectTarget = this;
this._hiding = false;
this._keepDisplay = false;
};
Sprite_GachaEffect.prototype.keepDisplay = function(value) {
this._keepDisplay = value;
};
Sprite_GachaEffect.prototype.update = function() {
Sprite.prototype.update.call(this);
this.updateVisibility();
this.updateAnimationSprites();
};
Sprite_GachaEffect.prototype.hide = function() {
this._hiding = true;
this.updateVisibility();
};
Sprite_GachaEffect.prototype.show = function() {
this._hiding = false;
this.updateVisibility();
};
Sprite_GachaEffect.prototype.updateVisibility = function() {
this.visible = !this._hiding;
};
Sprite_GachaEffect.prototype.updateAnimationSprites = function() {
if (this._animationSprites.length > 0) {
var sprites = this._animationSprites.clone();
this._animationSprites = [];
for (var i = 0; i < sprites.length; i++) {
var sprite = sprites[i];
if (sprite.isPlaying()) {
this._animationSprites.push(sprite);
} else {
if (!this._keepDisplay) {
sprite.remove();
}
else {
this._endSprites.push(sprite);
}
}
}
}
};
Sprite_GachaEffect.prototype.startAnimation = function(animation, mirror, delay) {
var sprite = new Sprite_Animation();
sprite.setup(this._effectTarget, animation, mirror, delay);
this.parent.addChild(sprite);
this._animationSprites.push(sprite);
};
Sprite_GachaEffect.prototype.isAnimationPlaying = function() {
return this._animationSprites.length > 0;
};
Sprite_GachaEffect.prototype.allRemove = function() {
var sprites, sprite, i;
if (this._animationSprites.length > 0) {
sprites = this._animationSprites.clone();
this._animationSprites = [];
for (i = 0; i < sprites.length; i++) {
sprite = sprites[i];
sprite.remove();
}
}
if (this._endSprites.length > 0) {
sprites = this._endSprites.clone();
this._endSprites = [];
for (i = 0; i < sprites.length; i++) {
sprite = sprites[i];
sprite.remove();
}
}
};
})();

View file

@ -0,0 +1,468 @@
//=============================================================================
// GachaBook.js
//
// (c)2016 KADOKAWA CORPORATION./YOJI OJIMA
//=============================================================================
/*:
* @plugindesc Displays detailed statuses of "gacha" items.
* @author Takeya Kimura
*
* @param Unknown Data
* @desc The index name for an unknown item.
* @default ??????
*
* @param Price Text
* @desc The text for "Price".
* @default Price
*
* @param Equip Text
* @desc The text for "Equip".
* @default Equip
*
* @param Type Text
* @desc The text for "Type".
* @default Type
*
* @param Rank Text
* @desc The text for "Rank".
* @default Rank
*
* @param Simple Display
* @desc The switch to display the name and description only.
* @default 0
*
* @help
*
* Plugin Command:
* GachaBook open # Open the gacha book screen
* GachaBook add weapon 3 # Add weapon #3 to the gacha book
* GachaBook add armor 4 # Add armor #4 to the gacha book
* GachaBook remove armor 5 # Remove armor #5 from the gacha book
* GachaBook remove item 6 # Remove item #6 from the gacha book
* GachaBook clear # Clear the item book
*/
/*:ja
* @plugindesc ガチャアイテム一覧を表示します
* @author Takeya Kimura
*
* @param Unknown Data
* @desc 未確認のガチャアイテムの名前です
* @default ??????
*
* @param Price Text
* @desc 価格の文字列です
* @default Price
*
* @param Equip Text
* @desc 装備の文字列です
* @default Equip
*
* @param Type Text
* @desc タイプの文字列です
* @default Type
*
* @param Rank Text
* @desc ランクの文字列です
* @default Rank
*
* @param Simple Display
* @desc 1と入力すると詳細表示が名前と説明だけになります[0: 通常表示 1: シンプル表示]
* @default 0
*
* @help
*
* Plugin Command:
* GachaBook open # ガチャブックを開きます
* GachaBook add weapon 3 # 武器3番をガチャブックに追加
* GachaBook add armor 4 # 防具4番をガチャブックに追加
* GachaBook remove armor 5 # 防具5番をガチャブックから削除
* GachaBook remove item 6 # アイテム6番をガチャブックから削除
* GachaBook clear # ガチャブックをクリアする
*/
(function() {
var parameters = PluginManager.parameters('GachaBook');
var unknownData;
var priceText;
var equipText;
var typeText;
var rankText;
Scene_Boot = class extends Scene_Boot {
start() {
super.start();
unknownData = LanguageManager.getMessageData("gacha_minigame.message_8").text;
priceText = LanguageManager.getMessageData("gacha_minigame.message_4").text;
equipText = LanguageManager.getMessageData("gacha_minigame.message_5").text;
typeText = LanguageManager.getMessageData("gacha_minigame.message_6").text;
rankText = LanguageManager.getMessageData("gacha_minigame.message_7").text;
}
}
var simpleDisplay = !!Number(parameters['Simple Display'] || 0);
var _Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'GachaBook') {
switch (args[0]) {
case 'open':
SceneManager.push(Scene_GachaBook);
break;
case 'add':
$gameSystem.addToGachaBook(args[1], Number(args[2]));
break;
case 'remove':
$gameSystem.removeFromGachaBook(args[1], Number(args[2]));
break;
case 'complete':
$gameSystem.completeGachaBook();
break;
case 'clear':
$gameSystem.clearGachaBook();
break;
}
}
};
Game_System.prototype.addToGachaBook = function(type, dataId) {
if (!this._GachaBookFlags) {
this.clearGachaBook();
}
var typeIndex = this.gachaBookTypeToIndex(type);
if (typeIndex >= 0) {
this._GachaBookFlags[typeIndex][dataId] = true;
}
};
Game_System.prototype.removeFromGachaBook = function(type, dataId) {
if (this._GachaBookFlags) {
var typeIndex = this.gachaBookTypeToIndex(type);
if (typeIndex >= 0) {
this._GachaBookFlags[typeIndex][dataId] = false;
}
}
};
Game_System.prototype.gachaBookTypeToIndex = function(type) {
switch (type) {
case 'item':
return 0;
case 'weapon':
return 1;
case 'armor':
return 2;
default:
return -1;
}
};
Game_System.prototype.completeGachaBook = function() {
var i;
this.clearGachaBook();
for (i = 1; i < $dataItems.length; i++) {
this._GachaBookFlags[0][i] = true;
}
for (i = 1; i < $dataWeapons.length; i++) {
this._GachaBookFlags[1][i] = true;
}
for (i = 1; i < $dataArmors.length; i++) {
this._GachaBookFlags[2][i] = true;
}
};
Game_System.prototype.clearGachaBook = function() {
this._GachaBookFlags = [[], [], []];
};
Game_System.prototype.isInGachaBook = function(item) {
if (this._GachaBookFlags && item) {
var typeIndex = -1;
if (DataManager.isItem(item)) {
typeIndex = 0;
} else if (DataManager.isWeapon(item)) {
typeIndex = 1;
} else if (DataManager.isArmor(item)) {
typeIndex = 2;
}
if (typeIndex >= 0) {
return !!this._GachaBookFlags[typeIndex][item.id];
} else {
return false;
}
} else {
return false;
}
};
var _Game_Party_gainItem = Game_Party.prototype.gainItem;
Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
_Game_Party_gainItem.call(this, item, amount, includeEquip);
if (item && amount > 0) {
var type;
if (DataManager.isItem(item)) {
type = 'item';
} else if (DataManager.isWeapon(item)) {
type = 'weapon';
} else if (DataManager.isArmor(item)) {
type = 'armor';
}
$gameSystem.addToGachaBook(type, item.id);
}
};
function Scene_GachaBook() {
this.initialize.apply(this, arguments);
}
Scene_GachaBook.prototype = Object.create(Scene_MenuBase.prototype);
Scene_GachaBook.prototype.constructor = Scene_GachaBook;
Scene_GachaBook.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
ImageManager.loadAtlas("gacha_prizes");
};
Scene_GachaBook.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._indexWindow = new Window_GachaBookIndex(0, 0);
this._indexWindow.setHandler('cancel', this.popScene.bind(this));
var wy = this._indexWindow.height;
var ww = Graphics.boxWidth;
var wh = Graphics.boxHeight - wy;
this._statusWindow = new Window_GachaBookStatus(0, wy, ww, wh);
this.addWindow(this._indexWindow);
this.addWindow(this._statusWindow);
this._indexWindow.setStatusWindow(this._statusWindow);
};
function Window_GachaBookIndex() {
this.initialize.apply(this, arguments);
}
Window_GachaBookIndex.prototype = Object.create(Window_Selectable.prototype);
Window_GachaBookIndex.prototype.constructor = Window_GachaBookIndex;
Window_GachaBookIndex.lastTopRow = 0;
Window_GachaBookIndex.lastIndex = 0;
Window_GachaBookIndex.prototype.initialize = function(x, y) {
var width = Graphics.boxWidth;
var height = this.fittingHeight(6);
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.refresh();
this.setTopRow(Window_GachaBookIndex.lastTopRow);
this.select(Window_GachaBookIndex.lastIndex);
this.activate();
};
Window_GachaBookIndex.prototype.isUsingCustomCursorRectSprite = function () { return true; };
Window_GachaBookIndex.prototype.maxCols = function() {
return 3;
};
Window_GachaBookIndex.prototype.maxItems = function() {
return this._list ? this._list.length : 0;
};
Window_GachaBookIndex.prototype.setStatusWindow = function(statusWindow) {
this._statusWindow = statusWindow;
this.updateStatus();
};
Window_GachaBookIndex.prototype.update = function() {
Window_Selectable.prototype.update.call(this);
this.updateStatus();
};
Window_GachaBookIndex.prototype.updateStatus = function() {
if (this._statusWindow) {
var item = this._list[this.index()];
this._statusWindow.setItem(item);
}
};
Window_GachaBookIndex.prototype.refresh = function() {
var i, item;
this._list = [];
for (i = 1; i < $dataItems.length; i++) {
item = $dataItems[i];
//if (item.name && item.itypeId === 1 && $gameSystem.isInGacha(item)) { //itypeIdはみない
if (item.name && $gameSystem.isInGacha(item)) { //itypeIdはみない
this._list.push(item);
}
}
for (i = 1; i < $dataWeapons.length; i++) {
item = $dataWeapons[i];
if (item.name && $gameSystem.isInGacha(item)) {
this._list.push(item);
}
}
for (i = 1; i < $dataArmors.length; i++) {
item = $dataArmors[i];
if (item.name && $gameSystem.isInGacha(item)) {
this._list.push(item);
}
}
this.createContents();
this.drawAllItems();
};
Window_GachaBookIndex.prototype.drawItem = function(index) {
var item = this._list[index];
var rect = this.itemRect(index);
var width = rect.width - this.textPadding();
if ($gameSystem.isInGachaBook(item)) {
this.drawItemName(item, rect.x, rect.y, width);
} else {
var iw = Window_Base._iconWidth + 4;
this.drawText(unknownData, rect.x + iw, rect.y, width - iw);
}
};
Window_GachaBookIndex.prototype.processCancel = function() {
Window_Selectable.prototype.processCancel.call(this);
Window_GachaBookIndex.lastTopRow = this.topRow();
Window_GachaBookIndex.lastIndex = this.index();
};
function Window_GachaBookStatus() {
this.initialize.apply(this, arguments);
}
Window_GachaBookStatus.prototype = Object.create(Window_Base.prototype);
Window_GachaBookStatus.prototype.constructor = Window_GachaBookStatus;
Window_GachaBookStatus.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._itemSprite = new Sprite();
this._itemSprite.anchor.x = 0.5;
this._itemSprite.anchor.y = 0.5;
this._itemSprite.x = width / 2 - 20;
this._itemSprite.y = height / 2;
this.addChildToBack(this._itemSprite);
this.refresh();
};
Window_GachaBookIndex.prototype.isUsingCustomCursorRectSprite = function () { return true; };
Window_GachaBookStatus.prototype.setItem = function(item) {
if (this._item !== item) {
this._item = item;
this.refresh();
}
};
Window_GachaBookStatus.prototype.update = function() {
Window_Base.prototype.update.call(this);
if (this._itemSprite.bitmap) {
var bitmapHeight = this._itemSprite.bitmap.height;
var contentsHeight = this.contents.height;
var scale = 1;
if (bitmapHeight > contentsHeight) {
scale = contentsHeight / bitmapHeight;
}
this._itemSprite.scale.x = scale;
this._itemSprite.scale.y = scale;
}
};
Window_GachaBookStatus.prototype.refresh = function() {
var item = this._item;
var x = 0;
var y = 0;
var lineHeight = this.lineHeight();
this.contents.clear();
if (!item || !$gameSystem.isInGachaBook(item)) {
this._itemSprite.bitmap = null;
return;
}
var bitmap;
if (!!item.meta.gachaImage) {
bitmap = ImageManager.loadPicture(item.meta.gachaImage);
bitmap.smooth = true;
}
this._itemSprite.bitmap = bitmap;
var iconBoxWidth = Window_Base._iconWidth + 4;
this.drawItemName(item, x, y);
this.drawItemNumber(item, x + this.textWidth(item.name) + iconBoxWidth, y);
x = this.textPadding();
y = lineHeight + this.textPadding();
if (!simpleDisplay) {
var rank = "-";
if (item.meta.gachaRank) rank = item.meta.gachaRank;
this.changeTextColor(this.systemColor());
this.drawText(rankText, x, y, 120);
this.resetTextColor();
this.drawText(rank, x + 120, y, 120, 'right');
y += lineHeight;
var price = item.price > 0 ? item.price : '-';
this.changeTextColor(this.systemColor());
this.drawText(priceText, x, y, 120);
this.resetTextColor();
this.drawText(price, x + 120, y, 120, 'right');
y += lineHeight;
if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {
var etype = $dataSystem.equipTypes[item.etypeId];
this.changeTextColor(this.systemColor());
this.drawText(equipText, x, y, 120);
this.resetTextColor();
this.drawText(etype, x + 120, y, 120, 'right');
y += lineHeight;
var type;
if (DataManager.isWeapon(item)) {
type = $dataSystem.weaponTypes[item.wtypeId];
} else {
type = $dataSystem.armorTypes[item.atypeId];
}
this.changeTextColor(this.systemColor());
this.drawText(typeText, x, y, 120);
this.resetTextColor();
this.drawText(type, x + 120, y, 120, 'right');
//x = this.textPadding() + 300;
//y = lineHeight + this.textPadding();
var rewardsWidth = 220;
x = this.contents.width - rewardsWidth;
y = lineHeight + this.textPadding();
for (var i = 2; i < 8; i++) {
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(i), x, y, 160);
this.resetTextColor();
this.drawText(item.params[i], x + 160, y, 60, 'right');
y += lineHeight;
}
}
}
x = 0;
y = this.textPadding() * 2 + lineHeight * 7;
this.drawTextEx(item.description, x, y);
};
Window_GachaBookStatus.prototype.numberWidth = function() {
return this.textWidth('000');
};
Window_GachaBookStatus.prototype.drawItemNumber = function(item, x, y) {
this.drawText(':', x, y);
this.drawText($gameParty.numItems(item), x + this.textWidth('00'), y);
};
})();

View file

@ -0,0 +1,374 @@
/*:
-------------------------------------------------------------------------
@title Enemy Reinforcements
@author Hime --> HimeWorks (http://himeworks.com)
@date Aug 15, 2016
@version 1.3
@filename HIME_EnemyReinforcements.js
@url http://himeworks.com/2015/11/enemy-reinforcements-mv/
If you enjoy my work, consider supporting me on Patreon!
* https://www.patreon.com/himeworks
If you have any questions or concerns, you can contact me at any of
the following sites:
* Main Website: http://himeworks.com
* Facebook: https://www.facebook.com/himeworkscom/
* Twitter: https://twitter.com/HimeWorks
* Youtube: https://www.youtube.com/c/HimeWorks
* Tumblr: http://himeworks.tumblr.com/
-------------------------------------------------------------------------
@plugindesc Allows you to summon more enemies into the current battle
using event commands.
@help
-------------------------------------------------------------------------
== Description ==
Video: https://youtu.be/ROy4nEoao-I
Do you want to add new enemies to battle, during the battle? This plugin
provides you with a variety of commands that allow you to create
more dynamic battles through enemy reinforcements.
You can create enemy skills that will essentially summon new enemies
to battle. Enemies can be added as a single enemy, or entire troops
of enemies.
Do you want to make sure a particular reinforcement does not already
exist? With this plugin, methods are provided to allow you to check
whether a certain enemy from a certain troop exists at a certain position.
If you want reinforcements to automatically disappear after a certain
amount of time has passed, you can easily do so by making a single
command to remove all enemy reinforcements from another troop!
== Terms of Use ==
- Free for use in non-commercial projects with credits
- Contact me for commercial use
== Change Log ==
1.3 - Aug 15, 2016
* Fix checking whether a certain member existed
1.2 - Nov 21, 2015
* member ID's weren't normalized to 1-based
1.1 - Nov 17, 2015
* fixed "needs alive" condition for checking if added
1.0 - Nov 16, 2015
* initial release
== Usage ==
When enemies are added to the battle, there are two questions that
need to be answered: which enemy is added, and where are they placed?
This plugin uses troops in the database to set up the enemy positions.
The enemy that will be added depends on the enemy that you choose in a
troop, and their position will be based on where they are in the troop.
Keep this numbering system in mind as you read on.
-- Adding Enemy Troops --
You can add entire troops to the current battle. When a troop is added,
all enemies in the other troop will be added, whether they should appear
half-way or not. To add a troop into battle, use the plugin command:
add_enemy_troop TROOP_ID
Where the TROOP_ID is the ID of the troop that you want to add.
For example, if the three slimes is troop 4, you would write
add_enemy_troop 4
-- Adding Certain Enemies from Troops --
Instead of adding an entire troop, you may want to add a specific enemy
from a specific troop. To add a specific enemy, use the plugin command:
add_enemy TROOP_MEMBER_ID from troop TROOP_ID
The TROOP_MEMBER_ID uses the numbering system that I described earlier.
So for example, if you wanted to add the second slime from the three\
slimes troop to battle, you would write
add_enemy 2 from troop 4
-- Removing Enemy Troops --
If you wish to remove a troop that was added to the battle (for example,
they are all retreating or their summon time has expired), you can use
the plugin command
remove_enemy_troop TROOP_ID
So for example if you want to remove the three slimes troop which is
troop 4, you can write
remove_enemy_troop 4
-- Removing Certain Enemies from Troops --
You can also remove certain enemies from certain troops. Use the plugin
command:
remove_enemy TROOP_MEMBER_ID from troop TROOP_ID
So for example, if you added the three slimes into the battle, but want
to remove the second one, you can say
remove_enemy 2 from troop 4
And only that specific enemy will be removed.
-- Checking whether a troop exists --
To check whether an entire troop exists, you can use the script call
$gameTroop.isTroopReinforcementAdded(troopId, checkIsAlive)
Which will return true if the specific troop exists. If you pass in
`true` for checking whether it's alive or not, it will return true if
any of the members from that troop are alive. If you don't pass in
anything, then it will return true if ANY members of the troop exists.
This is useful if you wanted the summons to only appear once (unless
you explicitly remove them).
-- Checking whether an enemy from a certain troop exists --
There are methods available for checking whether a certain troop member
exists. You can use this in a script call (such as a conditional branch):
$gameTroop.isEnemyReinforcementAdded(troopID, memberId, checkIsAlive)
Which will return true if the specific member from the specified troop
exists, and whether it's alive or not. If you pass in `true` for whether
it's alive or not, you can force it to check whether the enemy exists and
is alive.
For example, if you want to check if the second slime from troop 4 is
alive, you would write
$gameTroop.isEnemyReinforcementAdded(4, 2, true)
-------------------------------------------------------------------------
*/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.EnemyReinforcements = 1;
TH.EnemyReinforcements = TH.EnemyReinforcements || {};
(function ($) {
/* New. Refresh the spriteset to draw new enemies */
BattleManager.refreshEnemyReinforcements = function() {
if (this._spriteset) {
this._spriteset.refreshEnemyReinforcements();
}
}
/***************************************************************************/
Spriteset_Battle.prototype.removeEnemies = function() {
var sprites = this._enemySprites;
for (var i = 0; i < sprites.length; i++) {
this._battleField.removeChild(sprites[i]);
}
}
/* Delete all enemy sprites and re-draw them */
Spriteset_Battle.prototype.refreshEnemyReinforcements = function() {
this.removeEnemies();
this.createEnemies();
// this.createEnemyReinforcements();
}
Spriteset_Battle.prototype.createEnemyReinforcements = function() {
var enemies = $gameTroop.newReinforcements();
var sprites = [];
for (var i = 0; i < enemies.length; i++) {
sprites[i] = new Sprite_Enemy(enemies[i]);
}
sprites.sort(this.compareEnemySprite.bind(this));
for (var j = 0; j < sprites.length; j++) {
this._enemySprites.push(sprites[j]);
this._battleField.addChild(sprites[j]);
}
};
/***************************************************************************/
var TH_EnemyReinforcements_Game_Enemy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function(enemyId, x, y) {
TH_EnemyReinforcements_Game_Enemy_setup.call(this, enemyId, x, y);
this._troopId = $gameTroop.troop.id;
}
Game_Enemy.prototype.troopId = function() {
return this._troopId;
}
Game_Enemy.prototype.troopMemberId = function() {
return this._troopMemberId;
}
Game_Enemy.prototype.setTroopId = function(troopId) {
this._troopId = troopId;
};
Game_Enemy.prototype.setTroopMemberId = function(memberId) {
this._troopMemberId = memberId;
};
Game_Enemy.prototype.setupReinforcements = function(troopId, enemyId, x, y) {
this.setup(enemyId, x, y);
this._troopId = troopId;
};
/***************************************************************************/
var TH_EnemyReinforcements_GameTroop_Setup = Game_Troop.prototype.setup;
Game_Troop.prototype.setup = function(troopId) {
TH_EnemyReinforcements_GameTroop_Setup.call(this, troopId);
this.clearReinforcements();
}
Game_Troop.prototype.newReinforcements = function() {
return this._newEnemies;
};
Game_Troop.prototype.clearReinforcements = function() {
this._newEnemies = [];
};
Game_Troop.prototype.addReinforcementMember = function(troopId, memberId, member) {
if ($dataEnemies[member.enemyId]) {
var enemyId = member.enemyId;
var x = member.x;
var y = member.y;
var enemy = new Game_Enemy(enemyId, x, y);
enemy.setTroopId(troopId);
enemy.setTroopMemberId(memberId);
if (member.hidden) {
enemy.hide();
}
this._enemies.push(enemy);
this._newEnemies.push(enemy);
}
}
Game_Troop.prototype.addEnemyReinforcement = function(troopId, memberId) {
var member = $dataTroops[troopId].members[memberId - 1];
this.addReinforcementMember(troopId, memberId, member);
this.makeUniqueNames();
BattleManager.refreshEnemyReinforcements();
};
Game_Troop.prototype.addTroopReinforcements = function(troopId) {
var troop = $dataTroops[troopId];
var enemyId;
for (var i = 0; i < troop.members.length; i++) {
var member = troop.members[i];
this.addReinforcementMember(troopId, i, member);
}
this.makeUniqueNames();
BattleManager.refreshEnemyReinforcements();
};
Game_Troop.prototype.removeEnemyReinforcement = function(troopId, memberId) {
var member = $dataTroops[troopId].members[memberId - 1];
var enemies = this._enemies;
/* Start from the end of the array to avoid indexing issues */
for (var i = enemies.length - 1; i > -1; i--) {
if (enemies[i].troopId() === troopId && enemies[i].troopMemberId() === memberId) {
this._enemies.splice(i, 1);
}
}
BattleManager.refreshEnemyReinforcements();
}
Game_Troop.prototype.removeTroopReinforcements = function(troopId) {
var enemies = this._enemies;
/* Start from the end of the array to avoid indexing issues */
for (var i = enemies.length - 1; i > -1; i--) {
if (enemies[i].troopId() === troopId) {
this._enemies.splice(i, 1);
}
}
BattleManager.refreshEnemyReinforcements();
};
Game_Troop.prototype.isEnemyReinforcementAdded = function(troopId, memberId, needsAlive) {
var enemies = this._enemies;
for (var i = 0; i < enemies.length; i++) {
if (enemies[i].troopId() === troopId && enemies[i].troopMemberId() === memberId) {
/* Needs to be alive */
if (needsAlive) {
if (enemies[i].isAlive()) {
return true;
}
}
/* Doesn't need to be alive */
else {
return true;
}
}
}
return false;
};
Game_Troop.prototype.isTroopReinforcementAdded = function(troopId, needsAlive) {
var enemies = this._enemies;
for (var i = 0; i < enemies.length; i++) {
if (enemies[i].troopId() === troopId) {
/* Needs to be alive */
if (needsAlive) {
if (enemies[i].isAlive()) {
return true;
}
}
/* Doesn't need to be alive */
else {
return true;
}
}
}
return false;
};
/***************************************************************************/
var TH_EnemyReinforcements_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
// specify enemy from a certain troop
if (command.toLowerCase() === "add_enemy") {
var troopId = Math.floor(args[3]);
var memberId = Math.floor(args[0]);
$gameTroop.addEnemyReinforcement(troopId, memberId)
}
// add entire troop
else if (command.toLowerCase() === "add_enemy_troop") {
var troopId = Math.floor(args[0]);
$gameTroop.addTroopReinforcements(troopId);
}
else if (command.toLowerCase() === "remove_enemy") {
var troopId = Math.floor(args[3]);
var memberId = Math.floor(args[0]);
$gameTroop.removeEnemyReinforcement(troopId, memberId);
}
else if (command.toLowerCase() === "remove_enemy_troop") {
var troopId = Math.floor(args[0]);
$gameTroop.removeTroopReinforcements(troopId);
}
else {
TH_EnemyReinforcements_Game_Interpreter_pluginCommand.call(this, command, args);
}
};
})(TH.EnemyReinforcements);

View file

@ -0,0 +1,32 @@
/*:
* @plugindesc v1.00 Plugin to display a picture with a specific ID below characters
* but above tilemap. (Even if used with YED_Tiled plugin).
* @author Kentou
*
* @param Picture ID
* @desc The ID of the picture which should be displayed below characters.
* Default: 99
* @default 99
*
* @param Picture Z
* @desc The Z-Index of the picture which should be displayed below characters.
* Default: 2
* @default 2
*
* @help
* If you display a picture with Show Picture command, use the configured Picture ID to
* display the picture below the characters. All other picture commands behave
* normally.
*/
var _createPictures = Spriteset_Base.prototype.createPictures;
Spriteset_Base.prototype.createPictures = function() {
_createPictures.call(this);
if (this._tilemap) {
var params = PluginManager.parameters("KEN_PictureBelowChars");
var picID = parseInt(params["Picture ID"]);
var sprite = this._pictureContainer.removeChildAt(picID - 1);
sprite.z = sprite.zIndex = parseInt(params["Picture Z"]);
this._tilemap.addChild(sprite);
}
};

View file

@ -0,0 +1,178 @@
//=============================================================================
// Liquid's Lovely Plugin - Game_Event Data
// Liquid_EventData.js
//=============================================================================
var Imported = Imported || {};
Imported.Liquid_EventData = true;
var Liquid = Liquid || {};
Liquid.EventData = Liquid.EventData || {};
Liquid.EventData.version = 1.00;
//=============================================================================
/*:
* @plugindesc v1.0 Easibly add saveable data to events
* @author Liquidize
*
* @help
* ============================================================================
* Introduction and Instructions
* ============================================================================
*
* This plugin adds a new data object that allows end users to store variables
* and values for any event on any map and access said value in any script or
* event through easy to use functions.
*
* Functions are called via the $eventData global. It is similar in structure to
* $gameVariables, $gameSwitches, and $gameSelfSwitches.
*
* To make it easier for non-coders to use these functions in script calls to get
* or set values, some of the functions that you are used to for $gameVariables
* and the like have been "extended". These are as follows:
*
* $eventData.valueExt(CATEGORY,MAP_ID,EVENT_ID) - This function works similar to
* $gameVariables.value but for non programmers you need to specifiy every argument
* and then the function will build the "special key" in order to access the value.
*
* $eventData.setValueExt(CATEGORY,MAP_ID,EVENT_ID,VALUE) - This function like the
* above "valueExt" function works similar to $gameVariable.setValue except, just like
* the "valueExt" function you need to specify the Map and Event ID's as the function
* will build the key for you.
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.00:
* - Finished plugin!
*/
//=============================================================================
//=============================================================================
// Parameter Variables
//=============================================================================
Liquid.Parameters = PluginManager.parameters('Liquid_EventData');
Liquid.Param = Liquid.Param || {};
// Define Global
var $eventData = null;
//=============================================================================
// DataManager
//=============================================================================
Liquid.EventData.DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
$eventData = new Game_EventData();
Liquid.EventData.DataManager_createGameObjects.call(this);
};
Liquid.EventData.DataManager_makeSaveContents = DataManager.makeSaveContents;
DataManager.makeSaveContents = function() {
var contents = Liquid.EventData.DataManager_makeSaveContents.call(this);
contents.eventData = $eventData;
return contents;
};
Liquid.EventData.DataManager_extractSaveContents = DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
Liquid.EventData.DataManager_extractSaveContents.call(this,contents);
$eventData = contents.eventData;
};
//=============================================================================
// Game_EventData
//=============================================================================
// Constructor
function Game_EventData() {
this.initialize.apply(this, arguments);
}
// Initializer, clears/builds the data object
Game_EventData.prototype.initialize = function () {
this.clearAll();
};
// Adds a category to the data, specified by the argument "category"
// If no such category exists already
Game_EventData.prototype.addCategory = function (category) {
if (category && !this._data[category]) {
this._data[category] = {};
}
};
// Removes a category from the data, specified by the "category"
// argument if said category exists. This deletes ALL the values and
// information for said category.
Game_EventData.prototype.removeCategory = function(category) {
if (category && this._data[category]) {
delete this._data[category];
}
};
// This is basically a reset function, it clears
// the data and resets the object to default state
// removing all categories and information
Game_EventData.prototype.clearAll = function () {
this._data = {};
};
// This clears the specific category specified by
// "category".
Game_EventData.prototype.clear = function (category) {
if (category) {
this._data[category] = {};
}
};
// Checks if the data contains the specified category
// Returns true if it does, false if not
Game_EventData.prototype.hasCategory = function(category) {
if (category && this._data[category]) {
return true;
}
return false;
};
// Gets the value of the specified key in the specified category.
// Key is formatted as an array of MAP ID and EVENT ID.
// e.g: [1,1] - Map 1 Event Id 1
Game_EventData.prototype.value = function(category, key) {
return this._data[category][key];
};
// Extension of the value property to make calling the function easier for non-coders.
Game_EventData.prototype.valueExt = function(category, map, event, key) {
if (category && map && event) {
var key = [map, event];
return this.value(category,key);
}
};
// Sets the value of the specified key in the specified category with the specified value.
// The key is formated as an array of MAP ID and EVENT ID.
// e.g: [1,5] - For Map 1, Event 5
Game_EventData.prototype.setValue = function(category, key, value) {
if (value) {
this._data[category][key] = value;
} else {
delete this._data[category][key];
}
this.onChange();
};
// Extension of the setvalue function to make calling the function easier for non-coders.
Game_EventData.prototype.setValueExt = function(category,map,event,value) {
if (category && map && event) {
var key = [map, event];
this.setValue(category,key,value);
}
};
// This function is called when a value is changed to refresh the map.
Game_EventData.prototype.onChange = function () {
$gameMap.requestRefresh();
};

View file

@ -0,0 +1,355 @@
//=============================================================================
// Liquid's Lovely Plugin for Jasmin - Event Icons
// Liquid_EventIcons.js
//=============================================================================
var Imported = Imported || {};
Imported.Liquid_EventIcons = true;
var Liquid = Liquid || {};
Liquid.Eventcons = Liquid.Eventcons || {};
Liquid.Eventcons.version = 2.01;
//=============================================================================
/*:
* @plugindesc v2 adds persistent balloon icons.
* @author Liquidize
*
* @param ---General---
* @default
*
* @param Icon Width
* @parent ---General---
* @type number
* @min 0
* @desc Determines the width of each icon frame.
* Default: 32
* @default 32
*
* @param Icon Height
* @parent ---General---
* @type number
* @min 0
* @desc Determines the height of each icon frame.
* Default: 24
* @default 24
*
* @param Default Sprite Sheet
* @parent ---General---
* @type string
* @desc Determines the default sprite sheet to use for eventcons.
* Default: quest
* @default quest
*
* @param Speed
* @parent ---General---
* @type number
* @min 0
* @desc Determines the speed at which the frame is updated.
* Default: 16
* @default 16
*
* @param Wait Time
* @parent ---General---
* @type number
* @min 0
* @desc Helps determine the wait between each icon frame.
* Default: 64
* @default 64
*
* @help
* ============================================================================
* Introduction and Instructions
* ============================================================================
*
* To add an indicator add a note to the event with the following:
* Indicator: IMAGE_NAME,INDEX
*
* Example:
* Indicator: quest,1
*
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 2.01:
* - Fixed an issue where icons wouldn't change on the same map.
*
* Version 2.00:
* - Plugin redo!
*
* Version 1.02:
* - Added Plugin Command to change event icon
*
* Version 1.01:
* - Changed it so icons can be added via notes.
* - Made icons persist through saves properly.
*
* Version 1.00:
* - Finished plugin!
*/
//=============================================================================
//=============================================================================
// Parameter Variables
//=============================================================================
Liquid.Parameters = PluginManager.parameters('Liquid_EventIcons');
Liquid.Param = Liquid.Param || {};
Liquid.Param.EventconWidth = Number(Liquid.Parameters['Icon Width'] || 32);
Liquid.Param.EventconHeight = Number(Liquid.Parameters['Icon Height'] || 24);
Liquid.Param.EventconSheet = String(Liquid.Parameters['Default Sprite Sheet'] || 'quest');
Liquid.Param.EventconSpeed = Number(Liquid.Parameters['Speed'] || 16);
Liquid.Param.EventconWaitTime = Number(Liquid.Parameters['Wait Time'] || 64);
Liquid.Eventcons.Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
// Plugin Commands
if (command === "ChangeEventcon") {
if (args.length !== 4) {
return;
}
var map = parseInt(args[0]);
var event = parseInt(args[1]);
var img = args[2];
var index = parseInt(args[3]);
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
$eventData.setValueExt("eventcon", map, event, [img, index]);
if (map === $gameMap.mapId()) {
if ($gameMap._events[event]) {
$gameMap._events[event].removeEventcon();
$gameMap._events[event].setupEventcon(img,index);
}
}
} else if (command === "RemoveEventcon") {
if (args.length !== 2) {
return;
}
var map = parseInt(args[0]);
var event = parseInt(args[1]);
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
$eventData.setValueExt("eventcon", map, event);
if (map === $gameMap.mapId()) {
if ($gameMap._events[event]) {
$gameMap._events[event].removeEventcon();
}
}
}
Liquid.Eventcons.Game_Interpreter_pluginCommand.call(this, command, args);
};
//=============================================================================
// TDS PATCH : USE SCRIPT CALL
// this.setEventIcon(42, 'quest', 1);
//=============================================================================
Game_Interpreter.prototype.setEventIcon = function(eventId, img, index) {
var map = $gameMap.mapId();
var event = $gameMap.event(eventId);
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
$eventData.setValueExt("eventcon", map, eventId, [img, index]);
event.removeEventcon();
event.setupEventcon(img, index);
event.refresh();
};
//=============================================================================
// Game_CharacterBase
//=============================================================================
Game_CharacterBase.prototype.setupEventcon = function (img, index) {
if (this.isEventconPlaying()) {
this.removeEventcon();
}
this._eventImg = img;
this._eventIndex = index;
};
Game_CharacterBase.prototype.startEventcon = function () {
this._eventconPlaying = true;
};
Game_CharacterBase.prototype.isEventconPlaying = function () {
return this._eventIndex > 0 || this._eventconPlaying;
};
Game_CharacterBase.prototype.removeEventcon = function () {
this._eventImg = null;
this._eventIndex = -1;
this._eventconPlaying = false;
};
Game_CharacterBase.prototype.eventconId = function () {
return this._eventIndex;
};
Game_CharacterBase.prototype.eventconImg = function () {
return this._eventImg;
};
Game_CharacterBase.prototype.endEventcon = function () {
this._eventconPlaying = false;
};
//=============================================================================
// Game_Event
//=============================================================================
Liquid.Eventcons.Game_Event_refresh = Game_Event.prototype.refresh;
Game_Event.prototype.refresh = function () {
if (!this._eventIndex) {
if ($eventData.hasCategory("eventcon")) {
var eventIconInfo = $eventData.value("eventcon", [this._mapId, this._eventId]);
if (eventIconInfo) {
this.setupEventcon(eventIconInfo[0], eventIconInfo[1]);
}
} else if (this.event().note.match(/(?:INDICATOR):[ ](.+)[,](\d+)/i)) {
var img = String(RegExp.$1);
var index = Number(RegExp.$2);
this.setupEventcon(img, index);
if (!$eventData.hasCategory("eventcon")) {
$eventData.addCategory("eventcon");
}
$eventData.setValueExt("eventcon", this._mapId, this._eventId, [img, index]);
}
}
Liquid.Eventcons.Game_Event_refresh.call(this);
};
//=============================================================================
// Sprite_Character
//=============================================================================
Liquid.Eventcons.Sprite_Character_update = Sprite_Character.prototype.update;
Sprite_Character.prototype.update = function () {
Liquid.Eventcons.Sprite_Character_update.call(this);
this.updateEventcon();
};
Sprite_Character.prototype.setupEventcon = function () {
if (this._character.eventconId() > 0) {
this.startEventcon();
this._character.startEventcon();
if (!this.currentEventcondId) {
this.currentEventcondId = this._character.eventconId();
}
if (!this.currentEventcondImg) {
this.currentEventcondImg = this._character.eventconImg();
}
}
};
Sprite_Character.prototype.startEventcon = function () {
if (!this._eventconSprite || (this.currentEventcondId != this._character.eventconId()) || (this.currentEventcondImg != this._character.eventconImg())) {
this.endEventcon();
this._eventconSprite = new Sprite_EventCon();
this._eventconSprite.setup(this._character.eventconImg(), this._character.eventconId());
this.parent.addChild(this._eventconSprite);
this.currentEventcondId = this._character.eventconId();
this.currentEventcondImg = this._character.eventconImg();
}
};
Sprite_Character.prototype.updateEventcon = function () {
this.setupEventcon();
if (this._eventconSprite) {
this._eventconSprite.x = this.x;
this._eventconSprite.y = this.y - this.height;
if (!this._character.isEventconPlaying()) {
this.endEventcon();
}
}
};
Sprite_Character.prototype.endEventcon = function () {
if (this._eventconSprite) {
this.parent.removeChild(this._eventconSprite);
this._eventconSprite = null;
}
};
Sprite_Character.prototype.isEventconPlaying = function () {
return !!this._eventconSprite;
};
Liquid.Eventcons.Sprite_Character_updateAnimation = Sprite_Character.prototype.updateAnimation;
Sprite_Character.prototype.updateAnimation = function () {
Liquid.Eventcons.Sprite_Character_updateAnimation.call(this);
if (!this.isEventconPlaying()) {
this._character.endEventcon();
}
};
//=============================================================================
// Sprite_EventCon
//=============================================================================
function Sprite_EventCon() {
this.initialize.apply(this, arguments);
}
Sprite_EventCon.prototype = Object.create(Sprite_Base.prototype);
Sprite_EventCon.prototype.constructor = Sprite_EventCon;
Sprite_EventCon.prototype.initialize = function () {
Sprite_Base.prototype.initialize.call(this);
this.initMembers();
};
Sprite_EventCon.prototype.initMembers = function () {
this._eventconId = 0;
this._eventconImg = Liquid.Param.EventconSheet
this._duration = 0;
this.anchor.x = 0.5;
this.anchor.y = 1;
this.z = 7;
};
Sprite_EventCon.prototype.loadBitmap = function () {
this.bitmap = ImageManager.loadSystem(this._eventconImg);
this.setFrame(0, 0, 0, 0);
};
Sprite_EventCon.prototype.setup = function (img, index) {
this._eventconImg = img;
this._eventconId = index;
this._duration = 4 * this.speed() + this.waitTime();
this.loadBitmap();
};
Sprite_EventCon.prototype.update = function () {
Sprite_Base.prototype.update.call(this);
if (this._duration > 0) {
this._duration--;
if (this._duration > 0) {
this.updateFrame();
} else {
this._duration = 4 * this.speed() + this.waitTime();
}
}
};
Sprite_EventCon.prototype.updateFrame = function () {
var w = Liquid.Param.EventconWidth;
var h = Liquid.Param.EventconHeight;
var sx = this.frameIndex() * w;
var sy = (this._eventconId - 1) * h;
this.setFrame(sx, sy, w, h);
};
Sprite_EventCon.prototype.speed = function () {
return Liquid.Param.EventconSpeed;
};
Sprite_EventCon.prototype.waitTime = function () {
return Liquid.Param.EventconWaitTime;
};
Sprite_EventCon.prototype.frameIndex = function () {
var index = (this._duration - this.waitTime()) / this.speed();
return 3 - Math.max(Math.floor(index), 0);
};
Sprite_EventCon.prototype.isPlaying = function () {
return this._duration > 0;
};

View file

@ -0,0 +1,638 @@
//=============================================================================
// TDS Map Character Tag
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_MapCharacterTag = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.MapCharacterTag = _TDS_.MapCharacterTag || {};
//=============================================================================
/*:
* @plugindesc
* Shortcut for tag system
*
* @author TDS
*
*
* @param Common Event ID
* @desc ID of the common event to run after tagging.
* @default 1
*
* @param Selected Variable ID
* @desc ID of the variable to set selected tagged actor ID.
* @default 1
*
*
* @param Disable Switch ID
* @desc ID of the switch used to disable the tagging system.
* @default 1
*
*
*/
//=============================================================================
// Node.js path
var path = require('path');
// Get Parameters
var parameters = PluginManager.parameters("Map_Character_Tag");
// Initialize Parameters
_TDS_.MapCharacterTag.params = {};
_TDS_.MapCharacterTag.params.commonEventID = Number(parameters['Common Event ID'] || 1);
_TDS_.MapCharacterTag.params.selectedVariableID = Number(parameters['Selected Variable ID'] || 1);
_TDS_.MapCharacterTag.params.disableSwitchID = Number(parameters['Disable Switch ID'] || 1);
//=============================================================================
// ** Input
//-----------------------------------------------------------------------------
// The static class that handles input data from the keyboard and gamepads.
//=============================================================================
// Set Key Mapper A Key
Input.keyMapper[65] = 'tag';
//=============================================================================
// ** Scene_Map
//-----------------------------------------------------------------------------
// The scene class of the map screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.MapCharacterTag.Game_Player_canMove = Game_Player.prototype.canMove;
_TDS_.MapCharacterTag.Game_Player_canStartLocalEvents = Game_Player.prototype.canStartLocalEvents;
//=============================================================================
// * Can Use Map Character Tag
//=============================================================================
Game_Player.prototype.canUseCharacterTag = function() {
// Get Scene
const scene = SceneManager._scene;
// If scene exists and has can use character tag function return it
if (scene && scene.canUseCharacterTag) { return scene.canUseCharacterTag(); };
return false;
};
//=============================================================================
// * Determine if player can start local events
//=============================================================================
Game_Player.prototype.canStartLocalEvents = function() {
// If Map Character tag is visible
if (SceneManager._scene._mapCharacterTag.opacity > 0) { return false; };
// Return Original Function
return _TDS_.MapCharacterTag.Game_Player_canStartLocalEvents.call(this);
};
//=============================================================================
// * Can Move
//=============================================================================
Game_Player.prototype.canMove = function() {
// Input A is being pressed
let scene = SceneManager._scene;
let isTagging = scene._mapCharacterTag ? scene._mapCharacterTag.opacity > 0 : false;
if (!!isTagging) { return false; };
// return Original Function
return _TDS_.MapCharacterTag.Game_Player_canMove.call(this);
};
//=============================================================================
// ** Scene_Map
//-----------------------------------------------------------------------------
// The scene class of the map screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
_TDS_.MapCharacterTag.Scene_Map_update = Scene_Map.prototype.update;
_TDS_.MapCharacterTag.Scene_Map_terminate = Scene_Map.prototype.terminate;
//=============================================================================
// * Create Display Objects
//=============================================================================
Scene_Map.prototype.createDisplayObjects = function() {
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects.call(this);
// Create Map Character Tag
this.createMapCharacterTag();
};
//=============================================================================
// * Terminate
//=============================================================================
Scene_Map.prototype.terminate = function() {
// Hide Map Character Tag
this._mapCharacterTag.visible = false;
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_terminate.call(this);
};
//=============================================================================
// * Frame Update
//=============================================================================
Scene_Map.prototype.update = function() {
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_update.call(this);
// Update Character Tag
this.updateCharacterTagInput();
};
//=============================================================================
// * Create Map Character Tag
//=============================================================================
Scene_Map.prototype.createMapCharacterTag = function() {
// Create Map Character Tag Sprite
this._mapCharacterTag = new Sprite_MapCharacterTag();
this.addChild(this._mapCharacterTag);
};
//=============================================================================
// * Determine if Character Tag can be used
//=============================================================================
Scene_Map.prototype.canUseCharacterTag = function() {
// If Event is running return false
if ($gameMap.isEventRunning()) { return false; };
// If Party size is 1 or less
if ($gameParty.size() <= 1) { return false;};
// If Disable Switch is on return false
if ($gameSwitches.value(_TDS_.MapCharacterTag.params.disableSwitchID)) { return false; }
let scene = SceneManager._scene;
let isProcessingAnyMovement = !!$gamePlayer.isMoving() || !!$gamePlayer.followers().areMoving() || Input.isPressed("left") || Input.isPressed("right") || Input.isPressed("up") || Input.isPressed("down");
if (!!isProcessingAnyMovement) {return false;}
// Return true by default
return true;
};
//=============================================================================
// * Update Character Tag
//=============================================================================
Scene_Map.prototype.updateCharacterTagInput = function() {
// If Input Trigger A
if (Input.isTriggered('tag')) {
// If Can use Character Tag
if (this.canUseCharacterTag()) {
// Get Tag
var tag = this._mapCharacterTag;
// If Tag is Finished
if (tag._finished) {
// Show Tag
tag.show();
};
};
};
};
//=============================================================================
// ** Sprite_MapCharacterTag
//-----------------------------------------------------------------------------
// Ring Menu for Omori's tag system on the map.
//=============================================================================
function Sprite_MapCharacterTag() { this.initialize.apply(this, arguments);}
Sprite_MapCharacterTag.prototype = Object.create(Sprite.prototype);
Sprite_MapCharacterTag.prototype.constructor = Sprite_MapCharacterTag;
//=============================================================================
// * Initialize Object
//=============================================================================
Sprite_MapCharacterTag.prototype.initialize = function() {
// Super Call
Sprite.prototype.initialize.call(this);
// Initialize Settings
this.initSettings();
// Create Background
this.createBackground();
// Create Party Sprites
this.createPartySprites();
};
//=============================================================================
// * Create Background
//=============================================================================
Sprite_MapCharacterTag.prototype.createBackground = function() {
// Create Background
this._backgroundSprite = new Sprite();
this.addChild(this._backgroundSprite);
};
//=============================================================================
// * Initialize Settings
//=============================================================================
Sprite_MapCharacterTag.prototype.initSettings = function() {
// Amount of Frames for Startup Animation
this._startUpFrames = 13;
// Animation Frames for Movement Animation
this._movingFrames = 10;
// Radius of the ring
this._ringRadius = 160;
// Animation Steps
this._steps = -1;
// Set Center X & Y Valeus
this._centerX = Graphics.width / 2;
this._centerY = (Graphics.height / 2) - 10;
// Animation Type (Start, Wait, Move Right, Move Left)
this._anim = '';
// Set Index to
this._index = 0;
// Set Opacity to 0
this.opacity = 0;
// Set Released To false
this._released = false;
// Finished Flag
this._finished = true;
};
//=============================================================================
// * Create Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.createPartySprites = function() {
// Initialize Party Sprites
this._partySprites = [];
// Create Party Sprites Container
this._partySpritesContainer = new Sprite()
this._partySpritesContainer.opacity = 0;
this.addChild(this._partySpritesContainer);
// Iterate
for (var i = 0; i < 4; i++) {
var sprite = new Sprite_MapCharacterTagFace();
let text = LanguageManager.getMessageData("XX_BLUE.Map_Character_Tag").leader
sprite.setText(text);
sprite.x = this._centerX;
sprite.y = this._centerY;
this._partySprites[i] = sprite;
this._partySpritesContainer.addChild(sprite)
};
// Create Leader Sprite
this._leaderSprite = new Sprite_MapCharacterTagFace();
this._leaderSprite.x = this._centerX;
this._leaderSprite.y = this._centerY;
this._leaderSprite.showText();
let tagtext = LanguageManager.getMessageData("XX_BLUE.Map_Character_Tag").tag_who
this._leaderSprite.setText(tagtext)
this.addChild(this._leaderSprite);
// Refresh Party Sprites
this.refreshPartySprites();
};
//=============================================================================
// * Refresh Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.refreshPartySprites = function() {
for (var i = 0; i < this._partySprites.length; i++) {
// Get Sprite
var sprite = this._partySprites[i];
// Get Actor
var actor = $gameParty.members()[i];
sprite._faceSprite.actor = actor;
// Set Visibility
sprite.visible = actor !== undefined;
};
// Set Leader Sprite Face Sprite
this._leaderSprite._faceSprite.actor = $gameParty.leader();
};
//=============================================================================
// * Reset Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.resetPartySprites = function() {
for (var i = 0; i < this._partySprites.length; i++) {
// Get Sprite
var sprite = this._partySprites[i];
sprite.x = this._centerX;
sprite.y = this._centerY;
};
};
//=============================================================================
// * Activate & Deactivate
//=============================================================================
Sprite_MapCharacterTag.prototype.activate = function() { this._active = true; };
Sprite_MapCharacterTag.prototype.deactivate = function() { this._active = false; };
//=============================================================================
// * Determine if Animating
//=============================================================================
Sprite_MapCharacterTag.prototype.isAnimating = function() { return this._steps > -1; };
//=============================================================================
// * Determine if Inputs can be made
//=============================================================================
Sprite_MapCharacterTag.prototype.isInputable = function() {
if (this.isAnimating()) { return false; };
if (this._released) { return false; };
return true;
};
//=============================================================================
// * Get Max Items
//=============================================================================
Sprite_MapCharacterTag.prototype.maxItems = function() { return $gameParty.size(); };
//=============================================================================
// * Frame Update
//=============================================================================
Sprite_MapCharacterTag.prototype.update = function() {
// Super Call
Sprite.prototype.update.call(this);
// Update Animations
this.updateAnimations();
// Update Input
this.updateInput()
};
//=============================================================================
// * Move Left
//=============================================================================
Sprite_MapCharacterTag.prototype.moveLeft = function() {
// Set Steps
this._steps = this._movingFrames;
// Set Max
var max = this.maxItems();
// Set Index
this._index = (this._index - 1 + max) % max;
// Set Animation
this._anim = 'moveLeft';
};
//=============================================================================
// * Move Right
//=============================================================================
Sprite_MapCharacterTag.prototype.moveRight = function() {
// Set Steps
this._steps = this._movingFrames;
// Set Index
this._index = (this._index + 1) % this.maxItems();
// Set Animation
this._anim = 'moveRight'
};
//=============================================================================
// * Show
//=============================================================================
Sprite_MapCharacterTag.prototype.show = function() {
// Set Index to
this._index = 0;
// Refresh Party Sprites
this.refreshPartySprites();
// Reset Party Sprites
this.resetPartySprites();
// Snap Background Bitmap
SceneManager.snapForBackground(false);
// Set Background Bitmap
this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
this._backgroundSprite.opacity = 0;
this._backgroundSprite.blur = new PIXI.filters.BlurFilter();
this._backgroundSprite.filters = [this._backgroundSprite.blur];
this._backgroundSprite.blur.blur = 1;
this._backgroundSprite.blur.padding = 0;
// Set Party Sprites container Opacity
this._partySpritesContainer.opacity = 0;
// Start Startup Animation
this.startStartupAnim();
// Set Released To false
this._released = false;
// Finished Flag
this._finished = false;
};
//=============================================================================
// * Update Animations
//=============================================================================
Sprite_MapCharacterTag.prototype.onFinish = function() {
this._anim = null;
this._steps = -1;
this._backgroundSprite.bitmap = null;
this._released = false;
// Finished Flag
this._finished = true;
// If Index is more than 0
if (this._index > 0) {
// Get Actor ID
var actorId = $gameParty.members()[this._index].actorId();
// Set Actor ID Variable
$gameVariables.setValue(_TDS_.MapCharacterTag.params.selectedVariableID, actorId);
// Reserve Common Event
$gameTemp.reserveCommonEvent(_TDS_.MapCharacterTag.params.commonEventID);
};
// Reset Index
this._index = 0;
};
//=============================================================================
// * Update Animations
//=============================================================================
Sprite_MapCharacterTag.prototype.updateAnimations = function() {
// Set Release Flag
if (!this._released) {
// Set Active Flag
this._active = Input.isPressed('tag');
if (!this._active) {
this._released = true;
return;
};
} else if (!this._finished && this._released) {
// If Not Active
this.opacity -= 30;
// If Opacity is 0 or less set showing to false
if (this.opacity <= 0) {
// On Finish
this.onFinish();
};
return;
};
// If Steps is more than -1
if (!this._released && this._steps > -1) {
// Animation Switch Case
switch (this._anim) {
case 'start':
this.updateStartupAnim();
break;
case 'moveLeft':
this.updateMoveAnim(1);
break;
case 'moveRight':
this.updateMoveAnim(0)
break;
default:
// statements_def
break;
};
}
};
//=============================================================================
// * Update Input
//=============================================================================
Sprite_MapCharacterTag.prototype.updateInput = function() {
// If Inputable
if (this.isInputable()) {
// Left Input
if (Input.isRepeated('left')) { this.moveLeft(); };
// Right Input
if (Input.isRepeated('right')) { this.moveRight(); };
};
};
//=============================================================================
// * Start Startup Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.startStartupAnim = function() {
// Animation Steps
this._steps = this._startUpFrames;
// Set Animation Type
this._anim = 'start';
};
//=============================================================================
// * Update Startup Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateStartupAnim = function() {
// If Opacity is not at max
if (this.opacity < 255) {
// Increase Opacity
this.opacity += 60;
this._backgroundSprite.opacity += 60;
return;
}
var max = this.maxItems();
var d1 = 2.0 * Math.PI / max;
var d2 = 1.0 * Math.PI / this._startUpFrames;
var r = this._ringRadius - 1.0 * this._ringRadius * this._steps / this._startUpFrames;
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var d = d1 * i + d2 * this._steps;
sprite.x = this._centerX + (r * Math.sin(d));
sprite.y = this._centerY - (r * Math.cos(d));
sprite.hideText();
sprite._faceSprite.deactivate();
};
// If Steps are more than 0
if (this._steps > 0) {
// Set party container opacity
this._partySpritesContainer.opacity = (this._partySpritesContainer.opacity * (this._steps - 1) + 255) / this._steps;
};
// Decrease Steps
this._steps--;
// If Animation is over
if (this._steps < 0) { this.updateWaitAnim(); };
};
//=============================================================================
// * Update Wait Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateWaitAnim = function() {
var max = this.maxItems();
var d = 2.0 * Math.PI / max;
// Go Through Sprites
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var j = i - this._index;
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d * j)));
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d * j)))
if (i === this._index) {
sprite.showText();
sprite._faceSprite.activate();
} else {
sprite._faceSprite.deactivate();
sprite.hideText();
}
};
};
//=============================================================================
// * Update Move Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateMoveAnim = function(mode) {
var max = this.maxItems();
var d1 = 2.0 * Math.PI / max;
var d2 = d1 / this._movingFrames;
if (mode !== 0) { d2 *= -1; };
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var j = i - this._index;
var d = d1 * j + d2 * this._steps;
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d)));
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d)))
sprite.hideText();
};
// Decrease Steps
this._steps--;
// If Animation is over
if (this._steps < 0) { this.updateWaitAnim(); };
};
//=============================================================================
// ** Sprite_MapCharacterTagFace
//-----------------------------------------------------------------------------
// Animated Face Sprite for menus.
//=============================================================================
function Sprite_MapCharacterTagFace() { this.initialize.apply(this, arguments);}
Sprite_MapCharacterTagFace.prototype = Object.create(Sprite.prototype);
Sprite_MapCharacterTagFace.prototype.constructor = Sprite_MapCharacterTagFace;
//=============================================================================
// * Initialize Object
//=============================================================================
Sprite_MapCharacterTagFace.prototype.initialize = function() {
// Super Call
Sprite.prototype.initialize.call(this);
// Set Center Position
this.anchor.set(0.5, 0.5);
// Create Sprites
this.createBackgroundSprite();
this.createTextSprite();
this.createFaceSprite();
// Hide Text
this.hideText();
};
//=============================================================================
// * Create Background Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createBackgroundSprite = function() {
var bitmap = new Bitmap(110, 110 + 34)
bitmap.fillAll('rgba(0, 0, 0, 1)')
bitmap.fillRect(1, 1, bitmap.width - 2, bitmap.height - 2, 'rgba(255, 255, 255, 1)')
bitmap.fillRect(4, 4, bitmap.width - 8, 105, 'rgba(0, 0, 0, 1)')
bitmap.fillRect(0, 113, bitmap.width, 1, 'rgba(0, 0, 0, 1)')
bitmap.fillRect(4, 117, bitmap.width - 8, 22, 'rgba(0, 0, 0, 1)')
this._backgroundSprite = new Sprite(bitmap);
this._backgroundSprite.x = -(bitmap.width / 2);
this._backgroundSprite.y = -(110 / 2);
this.addChild(this._backgroundSprite);
};
//=============================================================================
// * Create Text Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createTextSprite = function() {
var bitmap = new Bitmap(110, 32);
this._textSprite = new Sprite(bitmap);
this._textSprite.anchor.set(0.5, 0);
this._textSprite.y = (144 / 2) - 18;
this.addChild(this._textSprite);
};
//=============================================================================
// * Create Face Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createFaceSprite = function() {
// Create Face Sprite
this._faceSprite = new Sprite_OmoMenuStatusFace();
this._faceSprite.anchor.set(0.5, 0.5)
this._faceSprite.actor = $gameParty.members()[0];
this._faceSprite.deactivate();
this.addChild(this._faceSprite);
this._faceMask = new Sprite(new Bitmap(110,110))
this._faceMask.x = -(110 / 2) + 2;
this._faceMask.y = -(110 / 2) + 2;
let white = 'rgba(255, 255, 255, 1)';
this._faceMask.bitmap.fillRect(0,0,106,2, white)
this._faceMask.bitmap.fillRect(104,0,2,106, white)
this.addChild(this._faceMask);
};
//=============================================================================
// * Activate & Deactivate
//=============================================================================
Sprite_MapCharacterTagFace.prototype.activate = function() { this._active = true; };
Sprite_MapCharacterTagFace.prototype.deactivate = function() { this._active = false; };
//=============================================================================
// * Show Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.setText = function(text) {
var bitmap = this._textSprite.bitmap;
bitmap.fontSize = LanguageManager.getMessageData("XX_BLUE.Sprite_MapCharacterTagFace").setText_fontsize;
bitmap.drawText(text, 0, 0, bitmap.width, bitmap.height, 'center');
};
//=============================================================================
// * Show Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.showText = function() {
this._backgroundSprite.setFrame(0, 0, 110, this._backgroundSprite.bitmap.height);
this._textSprite.visible = true;
};
//=============================================================================
// * Hide Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.hideText = function() {
this._backgroundSprite.setFrame(0, 0, 110, 114);
this._textSprite.visible = false;
};

View file

@ -0,0 +1,13 @@
/*=============================================================================
* OMORI -- Battle Formulas
* By Archeia - http://www.archeia.moe
*=============================================================================
//* -----------------------------------------------------------------------*/
//* Release Stress/Energy
//* this.omoriStressReleaseFormula(a, b)
//* -----------------------------------------------------------------------*/
Game_Action.prototype.omoriStressReleaseFormula = function(a, b) {
var value = a.level >= 30 ? 1000 : a.level >= 15 ? 600 : 300
return value;
};

View file

@ -0,0 +1,125 @@
//=============================================================================
// OggOnly.js
// PUBLIC DOMAIN
// ----------------------------------------------------------------------------
// 2018/07/23 国際化と微修正
//=============================================================================
/*:
* @plugindesc Use only ogg files to play the audio.
* @author krmbn0576
*
* @param deleteM4a
* @type boolean
* @text Delete all m4a files
* @desc Delete all m4a files the next time you playtest. Backup your files before execute.
* @default false
*
* @help
* Use only ogg files to play the audio such as BGM and SE.
* You need no longer to prepare m4a files.
*
* Usage:
* Locate stbvorbis.js, stbvorbis_asm.js, and this plugin in plugins directory.
* Turn ON Only this plugin, but DO NOT register the others to plugin manager.
*
*
* License:
* PUBLIC DOMAIN
*
* Thanks:
* This plugin uses stbvorbis.js(https://github.com/hajimehoshi/stbvorbis.js)
* as a ogg decoder. Thanks!
*/
/*:ja
* @plugindesc 音声ファイルの再生にoggファイルのみを使用します
* @author くらむぼん
*
* @param deleteM4a
* @type boolean
* @text m4aファイルを消去
* @desc 次にテストプレイを開始した時すべてのm4aファイルを削除します念の為バックアップを取った上でご活用ください
* @default false
*
* @help
* BGMや効果音などの音声ファイルにoggファイルのみを使用します
* 本プラグインを入れている場合m4aファイルを用意しなくても音声を再生できます
*
* 使い方
* pluginsフォルダに本プラグインとstbvorbis.jsとstbvorbis_asm.jsを配置してください
* 3つのうち本プラグインだけをプラグイン管理でONに設定してください
* 他のつは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

View file

@ -0,0 +1,438 @@
//=============================================================================
// Olivia Engine - Map Display Name Core - for RPG Maker MV version 1.6.1
// Olivia_MapDisplayNameCore.js
//=============================================================================
/*:
* @plugindesc <MapDisplayNameCore> for RPG Maker MV version 1.6.1.
* @author Fallen Angel Olivia
*
* @help
* This is a RPG Maker MV plugin that lets you control Map Display Names.
* They can now use text codes, have unique gradient colors, and can have
* custom defined fade times and duration.
*
* -----------------
* Plugin Parameters
* -----------------
*
* Change the plugin parameters to adjust the way your map name windows look.
*
* - Text Distance: The amount of distance between the edge of the gradient to
* the text in pixels.
*
* - Window Height: This is the height of the window.
*
* - Y Position:
* Starting Y: This is the Y coordinate for the map display window when it
* starts fades in.
* Middle Y: This is the Y coordinate for the map display window when it
* finishes fading in.
* Ending Y: This is the Y coordinate for the map display window when it
* finishes fading out.
*
* - Fade:
* Fade In Time: The number of frames to fade in the map display name.
* MIddle Time: The number of frames to wait before fading out.
* Fade Out Time: The number of frames to fade out the map display name.
*
* - Dim Color
* Dim Color 1: This is the default dim color 1 used. Use values in order of
* Red, Green, Blue, Alpha.
* Dim Color 2: This is the default dim color 2 used. Use values in order of
* Red, Green, Blue, Alpha.
*
* -----------------
* Custom Dim Colors
* -----------------
*
* You can use custom Dim Colors for special maps. Put these notetags into
* the map's note box.
*
* <Dim Color 1: r, g, b, a>
* <Dim Color 2: r, g, b, a>
*
* r = red (0-255)
* g = green (0-255)
* b = blue (0-255)
* a = alpha (0-100)
*
* For example, a yellow Dim Color 1 notetag would look like this:
*
* <Dim Color 1: 255, 255, 0, 60>
*
* -----------------
* Text Code Support
* -----------------
*
* Text codes like \n[1] and \v[2] are supported for map names. You can now
* put them inside of the map name to have them display the data shown with
* the text codes used.
*
* For example, "\n[1] Town" will be displayed as Harold Town.
*
* -----------------
* Override Map Name
* -----------------
*
* If you want to override the next map name that will be displayed, then use
* this Script Call event:
*
* var text = "Next Name Displayed";
* $gameMap.overrideMapName(text);
*
* The next map you enter will have the map name displaying the string in the
* text variable you put inside the Script Call Event. Then, it will clear
* itself and the next map you enter will have its usual name again and will no
* longer have an override map name.
*
* If you want to clear the override map name, then make a Script Call Event
* with this code:
*
* $gameMap.clearOverrideMapName();
*
* This will clear the override map name that is currently stored and the next
* map you enter will have the regular name instead.
*
* -------------------
* W A R N I N G ! ! !
* -------------------
*
* This plugin is made for RPG Maker MV versions 1.6.1 and below. If you update
* RPG Maker MV past that and this plugin breaks, I am NOT responsible for it.
*
* ------------
* Terms of Use
* ------------
*
* 1. These plugins may be used in free or commercial games.
* 2. 'Fallen Angel Olivia' must be given credit in your games.
* 3. You are allowed to edit the code.
* 4. Do NOT change the filename, parameters, and information of the plugin.
* 5. You are NOT allowed to redistribute these Plugins.
* 6. You may NOT take code for your own released Plugins without credit.
*
* -------
* Credits
* -------
*
* If you are using this plugin, credit the following people:
*
* - Fallen Angel Olivia
*
* @param
* @param
* @param ATTENTION!!!
* @default READ THE HELP FILE
* @param
* @param
*
* @param Text Distance
* @type number
* @desc The amount of distance between the edge of the gradient to the text in pixels.
* @default 80
*
* @param
*
* @param Window Height
* @type number
* @desc This is the height of the window.
* @default 36
*
* @param
*
* @param Y Position
*
* @param Starting Y
* @parent Y Position
* @type number
* @desc This is the Y coordinate for the map display window when it starts fades in.
* @default 18
*
* @param Middle Y
* @parent Y Position
* @type number
* @desc This is the Y coordinate for the map display window when it finishes fading in.
* @default 48
*
* @param Ending Y
* @parent Y Position
* @type number
* @desc This is the Y coordinate for the map display window when it finishes fading out.
* @default 78
*
* @param
*
* @param Fade
*
* @param Fade In Time
* @parent Fade
* @type number
* @desc The number of frames to fade in the map display name.
* @default 60
*
* @param Middle Time
* @parent Fade
* @type number
* @desc The number of frames to wait before fading out.
* @default 60
*
* @param Fade Out Time
* @parent Fade
* @type number
* @desc The number of frames to fade out the map display name.
* @default 60
*
* @param
*
* @param Dim Color
*
* @param Dim Color 1
* @parent Dim Color
* @desc This is the default dim color 1 used. Use values in order of Red, Green, Blue, Alpha.
* @default rgba(0, 0, 0, 0.6)
*
* @param Dim Color 2
* @parent Dim Color
* @desc This is the default dim color 2 used. Use values in order of Red, Green, Blue, Alpha.
* @default rgba(0, 0, 0, 0)
*
*
*/
//=============================================================================
var Imported = Imported || {};
Imported.Olivia_MapDisplayNameCore = true;
var Olivia = Olivia || {};
Olivia.MapDisplayNameCore = Olivia.MapDisplayNameCore || {};
var parameters = $plugins.filter(function(p) { return p.description.contains('<MapDisplayNameCore>') })[0].parameters;
Olivia.MapDisplayNameCore.TextDistance = Number(parameters['Text Distance'] || 80);
Olivia.MapDisplayNameCore.WindowHeight = Number(parameters['Window Height'] || 36);
Olivia.MapDisplayNameCore.YPosition = {
Starting: Number(parameters['Starting Y'] || 0),
Middle: Number(parameters['Middle Y'] || 0),
Ending: Number(parameters['Ending Y'] || 0)
}
Olivia.MapDisplayNameCore.Fade = {
In: Number(parameters['Fade In Time'] || 1),
Middle: Number(parameters['Middle Time'] || 1),
Out: Number(parameters['Fade Out Time'] || 1)
}
Olivia.MapDisplayNameCore.DimColor = {
Color1: String(parameters['Dim Color 1'] || 'rgba(0, 0, 0, 0.6)'),
Color2: String(parameters['Dim Color 2'] || 'rgba(0, 0, 0, 0)')
}
//-----------------------------------------------------------------------------
// Game_Map
//
// The game object class for a map. It contains scrolling and passage
// determination functions.
Game_Map.prototype.overrideMapName = function(text) {
this.overrideDisplayName(text);
};
Game_Map.prototype.overrideDisplayName = function(text) {
this._overrideDisplayName = text;
};
Game_Map.prototype.clearOverrideMapName = function() {
this.clearOverrideDisplayName();
};
Game_Map.prototype.clearOverrideDisplayName = function() {
this._overrideDisplayName = undefined;
};
Game_Map.prototype.displayName = function() {
if (this._overrideDisplayName) {
return this._overrideDisplayName;
} else {
return $dataMap.displayName;
}
};
Game_Map.prototype.displayNameDimColor1 = function() {
if ($dataMap.note.match(/<DIM COLOR 1:[ ]*(\d+(?:\s*,\s*\d+)*)>/i)) {
var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
var color = 'rgba(';
color += parseInt(array[0]).clamp(0, 255) + ',';
color += parseInt(array[1]).clamp(0, 255) + ',';
color += parseInt(array[2]).clamp(0, 255) + ',';
color += parseFloat(array[3] * 0.01).clamp(0, 1);
return color + ')';
} else {
return Olivia.MapDisplayNameCore.DimColor.Color1;
}
};
Game_Map.prototype.displayNameDimColor2 = function() {
if ($dataMap.note.match(/<DIM COLOR 2:[ ]*(\d+(?:\s*,\s*\d+)*)>/i)) {
var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
var color = 'rgba(';
color += parseInt(array[0]).clamp(0, 255) + ',';
color += parseInt(array[1]).clamp(0, 255) + ',';
color += parseInt(array[2]).clamp(0, 255) + ',';
color += parseFloat(array[3] * 0.01).clamp(0, 1);
return color + ')';
} else {
return Olivia.MapDisplayNameCore.DimColor.Color2;
}
};
//-----------------------------------------------------------------------------
// Window_MapName
//
// The window for displaying the map name on the map screen.
Window_MapName.prototype.initialize = function() {
var x = 0;
var y = Olivia.MapDisplayNameCore.YPosition.Starting;
var width = this.windowWidth();
var height = this.windowHeight();
this.setupFadeRate();
this.setupDisplayName();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._step = 'Fade In';
this.opacity = 0;
this.contentsOpacity = 0;
this._showCount = 0;
this.refresh();
};
Window_MapName.prototype.windowWidth = function() {
return Graphics.boxWidth;
};
Window_MapName.prototype.windowHeight = function() {
return Olivia.MapDisplayNameCore.WindowHeight;
};
Window_MapName.prototype.standardPadding = function() {
return 0;
};
Window_MapName.prototype.setupFadeRate = function() {
this._fadeInRate = Math.ceil(255 / Olivia.MapDisplayNameCore.Fade.In);
this._fadeOutRate = Math.ceil(255 / Olivia.MapDisplayNameCore.Fade.Out);
};
Window_MapName.prototype.setupDisplayName = function() {
this._text = $gameMap.displayName();
$gameMap.clearOverrideDisplayName();
};
Window_MapName.prototype.update = function() {
Window_Base.prototype.update.call(this);
if (this.isOpen() && this._showCount > 0 && $gameMap.isNameDisplayEnabled()) {
this.updateStep();
} else {
this.updateFadeOut();
}
};
Window_MapName.prototype.updateStep = function() {
this._showCount--;
var d = this._showCount;
if (this._step === 'Fade In') {
this.updateFadeIn();
var targetY = Olivia.MapDisplayNameCore.YPosition.Middle;
if (this._showCount <= 0) {
this._showCount = Olivia.MapDisplayNameCore.Fade.Middle;
this._step = 'Fade Middle';
}
} else if (this._step === 'Fade Middle') {
this.contentsOpacity = 255;
var targetY = Olivia.MapDisplayNameCore.YPosition.Middle;
if (this._showCount <= 0) {
this._showCount = Olivia.MapDisplayNameCore.Fade.Out;
this._step = 'Fade Out';
}
} else {
this.updateFadeOut();
var targetY = Olivia.MapDisplayNameCore.YPosition.Ending;
if (this._showCount <= 0) {
this.close();
}
}
if (d > 0) {
this.y = (this.y * (d - 1) + targetY) / d;
}
};
Window_MapName.prototype.updateFadeIn = function() {
this.contentsOpacity += this._fadeInRate;
};
Window_MapName.prototype.updateFadeOut = function() {
this.contentsOpacity -= this._fadeOutRate;
};
Window_MapName.prototype.open = function() {
this._step = 'Fade In';
this.refresh();
this._showCount = Olivia.MapDisplayNameCore.Fade.In;
};
Window_MapName.prototype.refresh = function() {
this.contents.clear();
var text = this._text;
if (text) {
var width = this.textWidthEx(text);
var distance = Olivia.MapDisplayNameCore.TextDistance;
width += distance * 2;
this.drawBackground(0, 0, width, this.windowHeight());
this.drawTextEx(text, distance, 0);
}
};
Window_MapName.prototype.dimColor1 = function() {
return $gameMap.displayNameDimColor1();
};
Window_MapName.prototype.dimColor2 = function() {
return $gameMap.displayNameDimColor2();
};
Window_MapName.prototype.textWidthEx = function(text) {
return this.drawTextEx(text, 0, this.contents.height);
};

View file

@ -0,0 +1,494 @@
//=============================================================================
// 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

View file

@ -0,0 +1,707 @@
//=============================================================================
// 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(); };
};
};

View file

@ -0,0 +1,290 @@
//=============================================================================
// 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

View file

@ -0,0 +1,929 @@
//=============================================================================
// ** 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;
};

Some files were not shown because too many files have changed in this diff Show more