设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 52|回复: 0

[转载发布] Advanced "Change Parameters" Script

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 前天 07:51 | 显示全部楼层 |阅读模式
    Advanced "Change Parameters"

    By IdkWhatsRc

    Features

    This script allows to use 4 different ways to use the Event command "Change Parameters".

    1. Set to a certain value

    2. Normally Increase/Decrease by a %.

    3. Specially Increase/Decrease by a %. (See script)

    4. Increase/Decrease by a certain value (Default)

    How to Use

    Check script.

    Demo

    http://www.mediafire...rgyg8979bdeclnw

    Script

    Spoiler#This is IdkWhatsRc's Advanced Parameter Change script.
    #This script is free to use for non-commercial and commercial games.
    #Please mention me in the credits section of your game if you use this script.
    #This is my first script ever.  

    #
    #
    # ==Basics==
    # Normally, the formula used is:
    # New Stat = Old Stat + Value
    # Ex: actor.maxhp += value
    #
    # With this script, you can modify the formula:
    #
    # To Set the Stat equal to the Value. (The value MUST be positive. AKA set to Increase and not Decrease.)
    # New Stat = Value
    # Ex: actor.maxhp = value
    #
    # To Increase/Decrease the Stat by a %
    # Increase/Decrease : New Stat = Old Stat * (Value + 100) / 100
    # Ex: actor.maxhp = actor.maxhp * (value + 100) /100
    #
    #Note: Increasing then decreasing by the same value will not result in the initial stat value.
    # Ex: 1000 * 10% = 1000 + 1000*10% = 1000 + 100 = 1100
    # 1100 - 10% = 1100 - 1100*10% = 1100 - 110 = 990
    # Inital = 1000
    # Final = 990
    #
    #
    #If you want to increase then decrease and come back to the same number, then:
    #
    # Increase/Decrease : New Stat = Old Stat * 100 / (100 - Value)
    # Ex: actor.maxhp = actor.maxhp * 100 / (100 - value)
    #
    # Note: You need to increase normally, then decrease specially to come back to the same value.
    # Still, increasing then decreasing by the same value may not result in the exact initial stat value.
    # This is because the engine rounds number.
    # Your new stat may have a ±1 difference with your inital stat.
    #
    #
    #
    # ==How to Use It==
    # To choose which formula you want to be used, you need to activate a certain switch.
    #
    # When Switch 14 is ON => Set the Stats equal to the Value.
    # When Switch 15 is ON => Increase/Decrease the Stat by a %
    # When Switch 16 is ON => Specially Decrease the Stat by a % (Check lign 29)
    # By Default (Switch 14, 15, 16 OFF) => Increase/Decrease by a number
    #
    # To change the Switch ID, simply use Ctrl+H. XD
    #
    # Basically, right before changing a Parameter:
    # 1. Turn ON Switch 14/15/16 if needed
    # 2. Change the Stat
    # 3. Turn OFF the Switch you activated in #1.
    #
    # Check the events for more details.
    #

    class Game_Interpreter

    def command_317
    value = operate_value(@params[2], @params[3], @params[4])
    actor = $game_actors[@params[0]]
    if actor != nil
    case @params[1]
    ##########################################
    ##########################################
    when 0 # Maximum HP
    if $game_switches[14] == true
    actor.maxhp = value
    end

    if $game_switches[15] == true
    actor.maxhp = actor.maxhp * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.maxhp = actor.maxhp * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.maxhp += value
    end
    end
    end
    ##########################################
    ##########################################
    when 1 # Maximum MP
    if $game_switches[14] == true
    actor.maxmp = value
    end

    if $game_switches[15] == true
    actor.maxmp = actor.maxmp * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.maxmp = actor.maxmp * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.maxmp += value
    end
    end
    end

    ##########################################
    ##########################################
    when 2 # Attack
    if $game_switches[14] == true
    actor.atk = value
    end

    if $game_switches[15] == true
    actor.atk = actor.atk * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.atk = actor.atk * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.atk += value
    end
    end
    end
    ##########################################
    ##########################################
    when 3 # Defense
    if $game_switches[14] == true
    actor.def = value
    end

    if $game_switches[15] == true
    actor.def = actor.def * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.def = actor.def * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.def += value
    end
    end
    end
    ##########################################
    ##########################################
    when 4 # Spirit
    if $game_switches[14] == true
    actor.spi = value
    end

    if $game_switches[15] == true
    actor.spi = actor.spi * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.spi = actor.spi * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.spi += value
    end
    end
    end
    ##########################################
    ##########################################
    when 5 # Agility
    if $game_switches[14] == true
    actor.agi = value
    end

    if $game_switches[15] == true
    actor.agi = actor.agi * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.agi = actor.agi * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.agi += value
    end
    end
    end
    ##########################################
    ##########################################
    end
    return true

    end
    end
    end

                    Code:        






    Credit and Thanks

    -IdkWhatsRc

    Author's Notes

    This is my first script ever.



    本贴来自国际rpgmaker官方论坛作者:IdkWhatsRc处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/advanced-change-parameters-script.4222/

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 02:11 , Processed in 0.063501 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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