查看: 1922|回复: 8

[有事请教] 如何让MOG的“战斗结果”插件速度快一点?

[复制链接]
梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
发表于 2023-2-28 16:50:11 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 nhycs01 于 2023-2-28 16:51 编辑

MOG的战斗结果插件:MOG_BattleResult
首先显示“胜利”图片,有一个缩放效果,
然后显示结算图片,也有一个拉伸效果,并且数字还要滚动一下,
接着显示战利品。
这一套下来感觉实在是太慢了,有没有方法让这个结算流程加快一些?或者将那个“胜利”图片的显示去掉,直接开始结算画面。
请大佬帮忙!
梦石
0
星屑
5483
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-2-28 17:30:45 | 显示全部楼层
本帖最后由 余杭 于 2023-2-28 17:32 编辑

js脚本里面找到
[pre lang="javascript"]BattleResult.prototype.createVict = function() {
        this._vict = new Sprite(this._vict_img);
        this._vict.opacity = 0;
        this._vict.scale.x = 3.0;
        this._vict.scale.y = 3.0;
        this._vict.anchor.x = 0.5;
        this._vict.anchor.y = 0.5;
        this._vict.x = Graphics.boxWidth / 2;
        this._vict.y = Graphics.boxHeight / 2;
        this.addChild(this._vict);
};[/pre]
删掉或者注释掉或许可以跳过胜利图片吧,我也没试过
回复

使用道具 举报

梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
 楼主| 发表于 2023-2-28 19:16:03 | 显示全部楼层
余杭 发表于 2023-2-28 17:30
js脚本里面找到
BattleResult.prototype.createVict = function() {
        this._vict = new Sprite(this._vict ...

刚刚测试,删掉会报错
回复

使用道具 举报

梦石
0
星屑
5649
在线时间
600 小时
注册时间
2020-2-20
回帖
217
发表于 2023-2-28 21:40:06 | 显示全部楼层
插眼,也有相同的困扰。
回复

使用道具 举报

梦石
0
星屑
5483
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-2-28 21:53:02 | 显示全部楼层
本帖最后由 余杭 于 2023-2-28 22:08 编辑

这个是调节图片的速度。
找到下列代码
  1. BattleResult.prototype.updateVictAnimation = function() {
  2.            if (this._phaseAnime[0] === 1) {
  3.                     if (this._vict.scale.x > 1.00) {
  4.                                 this._vict.scale.x -= 0.05;
  5.                                 this._vict.opacity += 15;
  6.                                 if (this._vict.scale.x <= 1.00) {
  7.                                         this._vict.scale.x = 1.00;
  8.                                         this._vict.opacity = 255;
  9.                                         this._phaseAnime[0] = 2;
  10.                                         this._phaseAnime[1] = 40;
  11.                                 };
  12.                         };
  13.            } else {
  14.                     if (this._vict.scale.x < 3.00) {
  15.                                 this._vict.scale.x += 0.05;
  16.                                 this._vict.opacity -= 10;
  17.                                 if (this._vict.scale.x >= 3.00) {
  18.                                         this._vict.scale.x = 3.00;
  19.                                         this._vict.opacity = 0;
  20.                                         this._phaseAnime[0] = 0;
  21.                                 };
  22.                         };                  
  23.            };
  24.            this._vict.scale.y = this._vict.scale.x;
  25. };
复制代码

其中,
  1. this._vict.scale.x +(-)= 0.05;
复制代码

控制胜利图片的出现和消失速度,你可以把第一个0.05改成1,第二个改成3
回复

使用道具 举报

梦石
0
星屑
5483
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-2-28 22:03:57 | 显示全部楼层
本帖最后由 余杭 于 2023-2-28 22:06 编辑

想要跳过的胜利图片的话,需要找到
[pre lang="javascript"]BattleResult.prototype.updateStart = function() {
    if (this._phaseAnime[0] > 0) {
        this.updateVictAnimation();
    } else {
        this.updateLayoutAnimation();
    };
};[/pre]
这一串代码,并且将 this.updateVictAnimation(); 替换为 this.updateLayoutAnimation();
这样就不用改之前那个回复的代码了
回复

使用道具 举报

梦石
0
星屑
5483
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-2-28 22:07:16 | 显示全部楼层
nie89 发表于 2023-2-28 21:40
插眼,也有相同的困扰。

最新那个回复可能有用

点评

感谢大佬,成功!  发表于 2023-2-28 22:16
感谢大佬  发表于 2023-2-28 22:08

评分

参与人数 2赞 +2 收起 理由
nie89 + 1 我很赞同
nhycs01 + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部