查看: 3535|回复: 0

[已经解决] soulsaga

[复制链接]
梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-7-28 14:10:47 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 j296196585 于 2017-7-30 10:46 编辑

MOG_EnemyHP请问如何破限
最大显示6位数 根本太少了吗 可以破限显示更多吗


[pre lang="javascript"]//=============================================================================
// MOG_EnemyHP.js
//=============================================================================

/*:
* @plugindesc (v1.4) Apresenta o HP do inimigo ao ataca-lo.
* @author Moghunter
*
* @param EHP Fade Duration
* @desc Definição do tempo para ativar o fade.
* (Default = 120)
* @default 120
*
* @param EHP Layout X-Axis
* @desc Posição X-Axis do layout.
* @default 0
*
* @param EHP Layout Y-Axis
* @desc Posição Y-Axis do layout.
* @default 0
*
* @param EHP Meter X-Axis
* @desc Posição X-Axis do medidor.
* @default 4
*
* @param EHP Meter Y-Axis
* @desc Posição Y-Axis do medidor.
* @default 2
+
* @help  
* =============================================================================
* +++ MOG - Enemy HP Meter (v1.4) +++
* By Moghunter
* https://atelierrgss.wordpress.com/
* =============================================================================
* Apresenta o HP do inimigo ao ataca-lo.
* Serão necessários os arquivos. (img/system/)
*
* EnemyHP_A.png
* EnemyHP_B.png
*
* Para ocultar o HP do inimigo use a seguinte Tag na caixa de notas
*
* Hide HP
*
* =============================================================================
* ** Histórico **
* =============================================================================
* (v1.4) Melhoria na compatibilidade de plugins.   
* (v1.3) Correção do Crash relativo as Notetags.  
* (v1.2) Melhoria na codificação.
* (v1.1) - Melhoria na animação do medidor vermelho.
*      - Mudança da Tag para ocular o hp para HIDE HP.
*      - Melhoria na codificação.
*/

//=============================================================================
// ** PLUGIN PARAMETERS
//=============================================================================
  var Imported = Imported || {};
  Imported.MOG_EnemyHP = true;
  var Moghunter = Moghunter || {};

   Moghunter.parameters = PluginManager.parameters('MOG_EnemyHP');
    Moghunter.enemyhp_a_x = Number(Moghunter.parameters['EHP Layout X-Axis'] || 0);
    Moghunter.enemyhp_a_y = Number(Moghunter.parameters['EHP Layout Y-Axis'] || 0);
    Moghunter.enemyhp_b_x = Number(Moghunter.parameters['EHP Meter X-Axis'] || 4);
    Moghunter.enemyhp_b_y = Number(Moghunter.parameters['EHP Meter Y-Axis'] || 2);       
    Moghunter.enemyhp_duration = Number(Moghunter.parameters['EHP Fade Duration'] || 120);

//=============================================================================
// ** Game Battler
//=============================================================================

//==============================
// * Notetags
//==============================
Game_Battler.prototype.notetags = function() {
        if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)};
        if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)};
};

//=============================================================================
// ** Game_Enemy
//=============================================================================

//==============================
// * Setup
//==============================
var _alias_mog_gba_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function(enemyId, x, y) {
        _alias_mog_gba_setup.call(this,enemyId, x, y);
        this._hp_meter = true
        for (var i = 0; i < this.notetags().length; i++) {
                if (this.notetags() == "Hide HP") {this._hp_meter = false};
        };               
};

//=============================================================================
// ** Spriteset_Battle
//=============================================================================       

//==============================
// * CreateLowerLayer
//==============================
var _alias_mog_enemyhp_createUpperLayer = Spriteset_Battle.prototype.createUpperLayer
Spriteset_Battle.prototype.createUpperLayer = function() {
        this.create_ehp_sprites();
        _alias_mog_enemyhp_createUpperLayer.call(this);       
};

//==============================
// * Update
//==============================
var _alias_mog_enemyhp_update = Spriteset_Battle.prototype.update
Spriteset_Battle.prototype.update = function() {
        _alias_mog_enemyhp_update.call(this);
        this.update_ehp_sprites();
};

//==============================
// * Create EHP Sprites
//==============================
Spriteset_Battle.prototype.create_ehp_sprites = function() {
        this._ehp_sprites_a = [];
        this._ehp_sprites_b = [];
        this._ehp_sprites_c = [];
        this._ehp_sprites_data = [];
    for (var i = 0; i < this._enemySprites.length; i++) {
                if (this._enemySprites._battler == null) {return;};
        this._ehp_sprites_a = new Sprite(ImageManager.loadSystem("EnemyHP_A"));
                this._ehp_sprites_b = new Sprite(ImageManager.loadSystem("EnemyHP_B"));
                this._ehp_sprites_c = new Sprite(ImageManager.loadSystem("EnemyHP_B"));
        this._ehp_sprites_a.opacity = 0;
                this._ehp_sprites_b.opacity = 0;
                this._ehp_sprites_c.opacity = 0;               
                this._ehp_sprites_a.z = 50;
                this._ehp_sprites_b.z = 51;
                this._ehp_sprites_c.z = 52;
                if (!this._enemySprites._battler._hp_meter) {this._ehp_sprites_a.visible = false};
                this._ehp_sprites_b.visible = this._ehp_sprites_a.visible
                this._ehp_sprites_c.visible = this._ehp_sprites_a.visible
                this._battleField.addChild(this._ehp_sprites_a);
                this._battleField.addChild(this._ehp_sprites_b);       
                this._battleField.addChild(this._ehp_sprites_c);       
                this._ehp_sprites_data = [this._enemySprites._battler.hp,0,0,Math.max(Moghunter.enemyhp_duration,32),this._enemySprites._battler.hp,];
    };
};

//==============================
// * Update EHP Sprites
//==============================
Spriteset_Battle.prototype.update_ehp_sprites = function() {
        for (var i = 0; i < this._enemySprites.length; i++) {
                if (this._ehp_sprites_a == null) {return;};
                if (!this._ehp_sprites_a.bitmap.isReady()) {return};               
                this._ehp_sprites_a.x = this._enemySprites.x + Moghunter.enemyhp_a_x +this._ehp_sprites_data[1] - (this._ehp_sprites_a.bitmap.width / 2);
                this._ehp_sprites_a.y = this._enemySprites.y + Moghunter.enemyhp_a_y;
                this._ehp_sprites_b.x = this._ehp_sprites_a.x + Moghunter.enemyhp_b_x;
                this._ehp_sprites_b.y = this._ehp_sprites_a.y + Moghunter.enemyhp_b_y;
                this._ehp_sprites_c.x = this._ehp_sprites_a.x + Moghunter.enemyhp_b_x;
                this._ehp_sprites_c.y = this._ehp_sprites_a.y + Moghunter.enemyhp_b_y;               
                this._ehp_sprites_b.opacity = this._ehp_sprites_a.opacity;
                this._ehp_sprites_c.opacity = this._ehp_sprites_a.opacity;
                this.update_ehp_red_bar(i);
                this.update_ehp_blue_bar(i)        ;
    };
};

//==============================
// * Update EHP Blue Bar
//==============================
Spriteset_Battle.prototype.update_ehp_blue_bar = function(i) {
                if (this._enemySprites._battler.isDead()) {
                        this._ehp_sprites_a.opacity -= 2;
                };
                if (this._ehp_sprites_data[2] > 0) {
                        this._ehp_sprites_data[2] -= 1
                };                 
                if (this._ehp_sprites_data[2] > this._ehp_sprites_data[3]) {
                        this._ehp_sprites_data[1] += 2;
                        this._ehp_sprites_a.opacity += 17
                } else {
                        if (this._ehp_sprites_data[1] < 30 && this._ehp_sprites_data[2] <= 15) {
                                this._ehp_sprites_data[1] += 2;this._ehp_sprites_a.opacity -= 17
                        };
                }               
                if (this._ehp_sprites_data[0] != this._enemySprites._battler.hp) {               
               
                        if (this._ehp_sprites_data[2] > 15 && this._ehp_sprites_data[2] <= this._ehp_sprites_data[3]) {
                                this._ehp_sprites_data[2] = this._ehp_sprites_data[3]
                        } else {
                                this._ehp_sprites_data[1] = -30;
                                this._ehp_sprites_data[2] = this._ehp_sprites_data[3] + 15;
                        }                               
                }
                this._ehp_sprites_data[0] = this._enemySprites._battler.hp;                    
                var meter_rate = this._ehp_sprites_c.bitmap.width * this._enemySprites._battler.hp / this._enemySprites._battler.mhp;
            this._ehp_sprites_c.setFrame(0, 0, meter_rate, this._ehp_sprites_c.bitmap.height / 2);
};

//==============================
// * Update EHP Red Bar
//==============================
Spriteset_Battle.prototype.update_ehp_red_bar = function(i) {
                if (this._ehp_sprites_data[4] != this._enemySprites._battler.hp) {
                                        var dnspeed = 1 + (Math.abs(this._ehp_sprites_data[4] - this._enemySprites._battler.hp) / (Moghunter.enemyhp_duration / 2));
                        if (this._ehp_sprites_data[4] > this._enemySprites._battler.hp) {
                            this._ehp_sprites_data[4] -= dnspeed;
                                if (this._ehp_sprites_data[4] < this._enemySprites._battler.hp ) {
                                    this._ehp_sprites_data[4] = this._enemySprites._battler.hp};
                        }
                        else if (this._ehp_sprites_data[4] < this._enemySprites._battler.hp) {
                            this._ehp_sprites_data[4] += dnspeed;
                                if (this._ehp_sprites_data[4] > this._enemySprites._battler.hp ) {
                                    this._ehp_sprites_data[4] = this._enemySprites._battler.hp};                       
                        }
                        var meter_rate = this._ehp_sprites_b.bitmap.width * this._ehp_sprites_data[4] / this._enemySprites._battler.mhp;
                     this._ehp_sprites_b.setFrame(0, this._ehp_sprites_b.bitmap.height / 2, meter_rate, this._ehp_sprites_b.bitmap.height / 2);
            };       
};[/pre]
360截图20170728140817029.jpg
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部