Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Snippet ver 1.1
- Scene_Equip.prototype.onItemOk = function() {
- SoundManager.playEquip();
- if (this._slotWindow.item()) {
- if (this._slotWindow.item().params[0] != 0){
- if (this.actor().isAlive()){
- this.actor()._hp -= this._slotWindow.item().params[0];
- if (this.actor()._hp < 1) this.actor()._hp = 1;
- }
- }
- if (this._slotWindow.item().params[1] != 0){
- this.actor()._mp -= this._slotWindow.item().params[1];
- if (this.actor()._mp < 0) this.actor()._mp = 0;
- }
- }
- this.actor().changeEquip(this._slotWindow.index(), this._itemWindow.item());
- this._slotWindow.activate();
- this._slotWindow.refresh();
- if (this._itemWindow.item()){
- if (this._itemWindow.item().params[0] != 0){
- if (this.actor().isAlive()){
- this.actor()._hp += this._itemWindow.item().params[0];
- if (this.actor()._hp < 1) this.actor()._hp = 1;
- }
- }
- if (this._itemWindow.item().params[1] != 0){
- this.actor()._mp += this._itemWindow.item().params[1];
- if (this.actor()._mp < 0) this.actor()._mp = 0;
- }
- }
- this._itemWindow.deselect();
- this._itemWindow.refresh();
- this._statusWindow.refresh();
- };
- Scene_Equip.prototype.commandOptimize = function() {
- SoundManager.playEquip();
- var MHP = this.actor().mhp;
- var MMP = this.actor().mmp;
- var hp = this.actor()._hp;
- var mp = this.actor()._mp;
- this.actor().optimizeEquipments();
- this._statusWindow.refresh();
- this._slotWindow.refresh();
- if (this.actor().isAlive()) this.actor()._hp = hp + (this.actor().mhp - MHP);
- this.actor()._mp = mp + (this.actor().mmp - MMP);
- this._commandWindow.activate();
- };
- Scene_Equip.prototype.commandClear = function() {
- SoundManager.playEquip();
- var MHP = this.actor().mhp;
- var MMP = this.actor().mmp;
- var hp = this.actor()._hp;
- var mp = this.actor()._mp;
- this.actor().clearEquipments();
- this._statusWindow.refresh();
- this._slotWindow.refresh();
- var test = hp + (this.actor().mhp - MHP);
- if (test < 1)
- {
- this.actor()._hp = 1;
- } else {
- this.actor()._hp = test;
- }
- if (this.actor().mmp - MMP < 0) mp -= this.actor().mmp - MMP;
- this._commandWindow.activate();
- };
- Game_Party.prototype.checkItemIsEquippedId = function(item) {
- for (var i = 1; i < $gameActors._data.length; ++i) {
- var actor = $gameActors.actor(i);
- if (!actor) continue;
- if (actor.equips().contains(item)) return i;
- }
- return 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement