查看: 12433|回复: 16

[原创发布] 丢弃物品插件

[复制链接]
梦石
0
星屑
2306
在线时间
1010 小时
注册时间
2012-4-30
回帖
1455

开拓者

发表于 2017-6-7 21:15:29 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 铅笔描绘的思念 于 2017-11-9 19:02 编辑

糊了一下午的丢弃物品插件  本来想和同样瞎糊的队伍负重整合起来发的
但是并没有糊好 选择以后再说
DumpItem.zip (1.57 KB, 下载次数: 319)
使用方法下载附件 解压 附件到你的工程文件夹下\js\plugins文件夹下
或者复制插件本体 在你的工程文件夹下\js\plugins文件夹下新建一个名为DumpItem.js

因为使用了插件设置所以插件的命名还是要固定的 顺便问下有没有好的不怕修改插件文件名的方法XD
截图 QQ截图20170607211324.png QQ截图20170607211331.png (这个照抄ShopNumber搞了我好久mmp)

插件本体 2017/11/9 fixed//=============================================================================
// DumpItem.js
//=============================================================================
/*:zh
* @plugindesc 可以在物品栏中丢弃物品
* @author 铅笔描绘的思念
*
* @param Dump
* @desc
* @default 丢弃
*
* @param Use
* @desc
* @default 使用
*
* @param CommandX
* @desc
* @default 350
*
* @param CommandY
* @desc
* @default 300
*
* @param NumberX
* @desc
* @default 180
*
* @param NumberY
* @desc
* @default 80
*
* @help This plugin does not provide plugin commands.
*
*/
(function () {
    var parameters = PluginManager.parameters('DumpItem');
    var dump = parameters['Dump'];
    var use = parameters['Use'];

    var commandX = parseInt(parameters['CommandX']);
    var commandY = parseInt(parameters['CommandY']);

    var numberX = parseInt(parameters['NumberX']);
    var numberY = parseInt(parameters['NumberY']);

    //Window_ItemNumber
    function Window_ItemNumber() {
        this.initialize.apply(this, arguments);
    }

    Window_ItemNumber.prototype = Object.create(Window_ShopNumber.prototype);
    Window_ItemNumber.prototype.constructor = Window_ItemNumber;

    Window_ItemNumber.prototype.initialize = function() {
        var height = 230;
        var x = numberX;
        var y = numberY;
        Window_ShopNumber.prototype.initialize.call(this, x, y, height);
        this.showButtons();
    };
    Window_ItemNumber.prototype.buttonY = function() {
        return Math.round( this.lineHeight() * 3.5);
    };
    Window_ItemNumber.prototype.refresh = function() {
        Window_ShopNumber.prototype.refresh.call(this);
        this.contents.clear();
        this.drawItemName(this._item, 4, this.fittingHeight(0));
        this.drawNumber();
    };
    Window_ItemNumber.prototype.itemY = function() {
        return this.fittingHeight(0);
    };
    //
    function Window_ItemCommand() {
        this.initialize.apply(this, arguments);
    }
    Window_ItemCommand.prototype = Object.create(Window_Command.prototype);
    Window_ItemCommand.prototype.constructor = Window_ItemCommand;

    Window_ItemCommand.prototype.initialize = function() {
        var x = commandX;
        var y = commandY;
        Window_Command.prototype.initialize.call(this, x, y);
    };
    Window_ItemCommand.prototype.makeCommandList = function() {
        this.addCommand(use, 'use');
        this.addCommand(dump, 'dump');
    };
    //
    Window_ItemList.prototype.isCurrentItemEnabled = function() {
        return true;
    };
    Window_ItemList.prototype.isEnabled = function(item) {
        return item;
    };
    //Scene_Item
    var _load_itemBase = Scene_Item.prototype.create;
    Scene_Item.prototype.create = function() {
        _load_itemBase.call(this);
        this.createItemCommandWindow();
        this.createItemNumberWindow();
        this.createActorWindow();
    };
    var _load_item = Scene_Item.prototype.createItemWindow;
    Scene_Item.prototype.createItemWindow = function() {
        _load_item.call(this);
        this._itemWindow.setHandler('ok',     this.onItemCommand.bind(this));
    };
    Scene_Item.prototype.onItemCommand = function() {
            if($gameParty.canUse(this.item())) {
            this._itemCommandWindow.show();
            this._itemCommandWindow.activate();
        }
    };
    Scene_Item.prototype.onItemOk = function() {
        if($gameParty.canUse(this.item())) {
            $gameParty.setLastItem(this.item());
            this.determineItem();
        }else{
            SoundManager.playBuzzer();
            this._itemCommandWindow.activate();
        }
    };
    Scene_ItemBase.prototype.determineItem = function() {
        var action = new Game_Action(this.user());
        var item = this.item();
        action.setItemObject(item);
        if (action.isForFriend()) {
            this.showSubWindow(this._actorWindow);
            this._actorWindow.selectForItem(this.item());
        } else {
            this.useItem();
            this._itemCommandWindow.activate();
        }
    };
    Scene_Item.prototype.createItemCommandWindow = function() {
        this._itemCommandWindow = new Window_ItemCommand();
        this._itemCommandWindow.hide();
        this._itemCommandWindow.setHandler('use',     this.onItemOk.bind(this));
        this._itemCommandWindow.setHandler('dump',     this.onItemDump.bind(this));
        this._itemCommandWindow.setHandler('cancel', this.onCommandCancel.bind(this));
        this.addWindow(this._itemCommandWindow);
    };

    Scene_Item.prototype.hideSubWindow = function(window) {
        window.hide();
        window.deactivate();
        this._itemCommandWindow.activate();
    };
    Scene_Item.prototype.onCommandCancel = function() {
        this._itemCommandWindow.hide();
        this._itemWindow.activate();
        this._itemWindow.refresh();
    };
    Scene_Item.prototype.createItemNumberWindow = function() {
        this._itemNumberWindow = new Window_ItemNumber();
        this._itemNumberWindow.hide();
        this._itemNumberWindow.setHandler('ok',     this.onNumberOk.bind(this));
        this._itemNumberWindow.setHandler('cancel', this.onNumberCancel.bind(this));
        this.addWindow(this._itemNumberWindow);
    };
    Scene_Item.prototype.onNumberOk = function() {
        var number = this._itemNumberWindow.number();
        SoundManager.playShop();
        this.doItemDump(number);
        this._itemCommandWindow.hide();
        this._itemNumberWindow.hide();
        this._itemWindow.activate();
        this._itemWindow.refresh();
    };
    Scene_Item.prototype.onNumberCancel = function() {
        SoundManager.playCancel();
        this._itemNumberWindow.hide();
        this._itemCommandWindow.activate();
    };
    Scene_Item.prototype.onItemDump = function() {
        var item = this._itemWindow.item();
        if(this.canDump()){
            SoundManager.playOk();
            this._itemNumberWindow.setup(item, $gameParty.numItems(item),item.price);
            this._itemNumberWindow.show();
            this._itemNumberWindow.activate();
            this._itemCommandWindow.deactivate();
        }else{
            SoundManager.playBuzzer();
            this._itemCommandWindow.activate();
        }
    };

    Scene_Item.prototype.doItemDump = function(number) {
        $gameParty.loseItem(this._itemWindow.item(), number)

    };
    Scene_Item.prototype.canDump = function() {
        return this._categoryWindow.currentSymbol() != 'keyItem';
    }
})();


评分

参与人数 3星屑 +676 赞 +1 收起 理由
银河异次元 + 1 精品文章
白嫩白嫩的 + 10 塞糖
fux2 + 666 塞糖

查看全部评分

老黄鸡

梦石
4
星屑
45700
在线时间
7948 小时
注册时间
2009-7-6
回帖
13338

MZ评测员RM创作大赛01组委会开拓者贵宾

发表于 2017-6-8 00:22:57 | 显示全部楼层
丢弃物品这个功能好像很少在游戏里看到,玩家一般都会选择卖掉。

点评

对那种严格限制背包空间的生存类游戏应该是有用的  发表于 2017-6-8 11:14
RGDirect - DirectX驱动的RGSS,点我了解.
(排满,暂停)RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

梦石
0
星屑
567
在线时间
60 小时
注册时间
2013-7-17
回帖
2
发表于 2017-7-25 15:31:10 | 显示全部楼层
嗯...求解丢弃和使用的文字没有显示出来
回复

使用道具 举报

梦石
0
星屑
5170
在线时间
610 小时
注册时间
2017-10-21
回帖
321
发表于 2017-10-22 16:52:25 | 显示全部楼层
感谢大佬~~~
回复

使用道具 举报

梦石
0
星屑
5333
在线时间
454 小时
注册时间
2017-9-27
回帖
69
发表于 2017-10-23 10:01:39 | 显示全部楼层
如果包里没物品,选择丢弃你猜会怎么样
回复

使用道具 举报

梦石
0
星屑
180
在线时间
39 小时
注册时间
2017-10-23
回帖
19
发表于 2017-10-23 11:59:41 | 显示全部楼层
感谢大佬分享
回复

使用道具 举报

梦石
0
星屑
5333
在线时间
454 小时
注册时间
2017-9-27
回帖
69
发表于 2017-11-9 16:11:36 | 显示全部楼层
包里没有物品的时候选择丢弃,就会报错!!!这bug不修吗?

点评

测试了下, 老的系统库还是存在卡死的bug。新的正常······  发表于 2017-11-10 20:09
随手修了下_(:з」∠)_  发表于 2017-11-9 19:02
唔我去看看  发表于 2017-11-9 18:06
回复

使用道具 举报

梦石
0
星屑
15294
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 2017-11-10 16:28:41 | 显示全部楼层
可以非常有用的一个插件
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复

使用道具 举报

梦石
0
星屑
159
在线时间
13 小时
注册时间
2018-9-23
回帖
36
发表于 2018-9-24 03:48:40 | 显示全部楼层
谢谢大佬的分享!
果砸的哔哩哔哩67679336!欢迎关注!一个沉迷开发游戏的小萝莉!
回复

使用道具 举报

梦石
0
星屑
46
在线时间
5 小时
注册时间
2018-10-15
回帖
3
发表于 2018-11-4 20:04:24 | 显示全部楼层
求问大佬,在没有物品的时候按确认键会卡死,请问如何修正啊?
回复 1 0

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部