扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 154|回复: 0

[转载发布] 天气加强插件

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10465
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13215

    灌水之王

    发表于 2024-2-13 12:30:55 | 显示全部楼层 |阅读模式
    [code]//=============================================================================
    // Lanza_WeatherAdvance.js
    // by Lanza
    // Last Updated: 2015.12.27
    //=============================================================================
    var Lanza = Lanza || {};
    Lanza.WeatherAdvance = Lanza.WeatherAdvance || {};
    Lanza.rand = function(max){
            return Math.floor(Math.random()*(max + 1));
    }
    /*:
    * @plugindesc 此插件移植于一个日站的天气加强脚本(真的忘了具体来源了……), 总之还是很实用的。
    * @author Lanza
    *
    * @help
    *
    * 插件命令:
    *        Set_Weather type, power, duration, wait        # 设定天气: 类型名(下表), 强度(1 ~ 9), 渐变时间(1 / 60 sec), 是否等待(true, false)
    *        类型名:
    *        hail                 -                 冰雹
    *        petal                -                樱花瓣
    *        bloodrain        -                血雨
    *        ash                        -                尘埃
    *        bubble                -                泡泡
    *
    */
    //=============================================================================
    // Game_Interpreter
    //=============================================================================
    Lanza.WeatherAdvance.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        Lanza.WeatherAdvance.Game_Interpreter_pluginCommand.call(this, command, args);
        if(command === 'Set_Weather'){
                    args[1] = parseInt(args[1]);
                    args[2] = parseInt(args[2]);
                    if (!$gameParty.inBattle()) {
                            $gameScreen.changeWeather(args[0], args[1], args[2]);
                            if (args[3] == 'true') {
                                    this.wait(args[2]);
                            }
                    }
                    return true;
            }
    };

    //=============================================================================
    // Weather
    //=============================================================================
    Lanza.WeatherAdvance.Weather_createBitmaps = Weather.prototype._createBitmaps;
    Weather.prototype._createBitmaps = function() {
            // 颜色
            var blueGrey         = Utils.rgbToCssColor(215, 227, 227);
            var grey                 = Utils.rgbToCssColor(214, 217, 217);
            var aqua                = Utils.rgbToCssColor(197, 253, 254);
            var lavender        = Utils.rgbToCssColor(225, 190, 244);
            var lightGrey         = Utils.rgbToCssColor(233, 233, 233);
            var lightBlue         = Utils.rgbToCssColor(222, 239, 243);
            var lightPink         = Utils.rgbToCssColor(255, 167, 192);
            var darkRed         = Utils.rgbToCssColor(141, 9, 9);
            var darkBlue        = Utils.rgbToCssColor(77, 136, 225);
            var darkPink         = Utils.rgbToCssColor(213, 106, 136);
            // 冰雹
        this._hail_bitmap = new Bitmap(4, 4);
            this._hail_bitmap.fillRect(1, 0, 2, 1, blueGrey);
            this._hail_bitmap.fillRect(0, 1, 1, 2, blueGrey);
            this._hail_bitmap.fillRect(3, 1, 1, 2, grey);
            this._hail_bitmap.fillRect(1, 3, 2, 1, grey);
            this._hail_bitmap.fillRect(1, 1, 2, 2, lightGrey);
            this._hail_bitmap.fillRect(1, 1, 1, 1, lightBlue);
            // 樱花
            this._petal_bitmap = new Bitmap(4, 4);
            this._petal_bitmap.fillRect(0, 3, 1, 1, lightPink);
            this._petal_bitmap.fillRect(1, 2, 1, 1, lightPink);
            this._petal_bitmap.fillRect(2, 1, 1, 1, lightPink);
            this._petal_bitmap.fillRect(3, 0, 1, 1, lightPink);
            this._petal_bitmap.fillRect(1, 3, 1, 1, darkPink);
            this._petal_bitmap.fillRect(2, 2, 1, 1, darkPink);
            this._petal_bitmap.fillRect(3, 1, 1, 1, darkPink);
            // 血雨
            this._bloodrain_bitmap = new Bitmap(7, 56);
            for(var i = 0;i < 6;i++){
                    this._bloodrain_bitmap.fillRect(6 - i, i * 8, 1, 8, darkRed);
            }
            this._bloodrain_splash_bitmap = new Bitmap(8, 5);
            this._bloodrain_splash_bitmap.fillRect(1, 0, 6, 1, darkRed);
            this._bloodrain_splash_bitmap.fillRect(1, 4, 6, 1, darkRed);
            this._bloodrain_splash_bitmap.fillRect(0, 1, 1, 3, darkRed);
            this._bloodrain_splash_bitmap.fillRect(7, 1, 1, 3, darkRed);
            // 尘埃
            this._ash_bitmap = new Bitmap(3, 3);
            this._ash_bitmap.fillRect(0, 1, 1, 3, lightGrey);
            this._ash_bitmap.fillRect(1, 0, 3, 1, lightGrey);
            this._ash_bitmap.fillRect(1, 1, 1, 1, 'white');
            // 泡泡
            this._bubble_bitmap = new Bitmap(24, 24);
            this._bubble_bitmap.fillRect(0, 9, 24, 5, darkBlue);
            this._bubble_bitmap.fillRect(1, 6, 22, 11, darkBlue);
            this._bubble_bitmap.fillRect(2, 5, 20, 13, darkBlue);
            this._bubble_bitmap.fillRect(3, 4, 18, 15, darkBlue);
            this._bubble_bitmap.fillRect(4, 3, 16, 17, darkBlue);
            this._bubble_bitmap.fillRect(5, 2, 14, 19, darkBlue);
            this._bubble_bitmap.fillRect(6, 1, 12, 21, darkBlue);
            this._bubble_bitmap.fillRect(9, 0, 5, 24, darkBlue);
            this._bubble_bitmap.fillRect(2, 11, 20, 4, aqua);
            this._bubble_bitmap.fillRect(3, 7, 18, 10, aqua);
            this._bubble_bitmap.fillRect(4, 6, 16, 12, aqua);
            this._bubble_bitmap.fillRect(5, 5, 14, 14, aqua);
            this._bubble_bitmap.fillRect(6, 4, 12, 16, aqua);
            this._bubble_bitmap.fillRect(9, 2, 4, 20, aqua);
            this._bubble_bitmap.fillRect(5, 10, 1, 7, lavender);
            this._bubble_bitmap.fillRect(6, 14, 1, 5, lavender);
            this._bubble_bitmap.fillRect(7, 15, 1, 4, lavender);
            this._bubble_bitmap.fillRect(8, 16, 1, 4, lavender);
            this._bubble_bitmap.fillRect(9, 17, 1, 3, lavender);
            this._bubble_bitmap.fillRect(10, 18, 4, 3, lavender);
            this._bubble_bitmap.fillRect(14, 18, 1, 2, lavender);
            this._bubble_bitmap.fillRect(13, 5, 4, 4, 'white');
            this._bubble_bitmap.fillRect(14, 4, 2, 1, 'white');
            this._bubble_bitmap.fillRect(17, 6, 1, 1, 'white');
            //
            // 原生图形
            Lanza.WeatherAdvance.Weather_createBitmaps.call(this);
    };

    Lanza.WeatherAdvance.Weather_updateSprite = Weather.prototype._updateSprite;
    Weather.prototype._updateSprite = function(sprite) {
            switch (this.type) {
        case 'hail':
            this._updateHailSprite(sprite);
            break;
        case 'petal':
            this._updatePetalSprite(sprite);
            break;
            case 'bloodrain':
            this._updateBloodrainSprite(sprite);
            break;
            case 'ash':
            this._updateAshSprite(sprite);
            break;
            case 'bubble':
            this._updateBubbleSprite(sprite);
            break;
        }
            Lanza.WeatherAdvance.Weather_updateSprite.call(this, sprite);
    };

    Weather.prototype._updateHailSprite = function(sprite) {
        sprite.bitmap = this._hail_bitmap;
        sprite.ax -= 1;
        sprite.ay += 18;
        sprite.opacity -= 15;
    };

    Weather.prototype._updatePetalSprite = function(sprite) {
        sprite.bitmap = this._petal_bitmap;
        sprite.ax -= 1;
        sprite.ay += 1;
            sprite.opacity -= 4;
    };

    Weather.prototype._updateBloodrainSprite = function(sprite) {
            if(sprite.opacity

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 11:46 , Processed in 0.135860 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表