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

[转载发布] Simple Skill Check

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 19:00 | 显示全部楼层 |阅读模式
    Code:       
    1. SkillCheck v1.30
    2. Dark Confidant
    3. *You can now also save the name of the actor the did the skill check for you.
    4. [SIZE=26px]Introduction[/SIZE]
    5. A Simple Plugin to Check a certain stat among actors and set the largest of them to a variable.
    6. it can be used for so many cool things like to see if a player can sneak pass a guard or to see
    7. if i player can find extra loot in a chest or find a hidden room.
    8. [SIZE=26px]Features[/SIZE]
    9. Find out who has the highest of each stat in your party
    10. Current Supported Stats (ATK, DEF, MDF, AGI, LUK. MAT)
    11. Save the largest Value as a variable of your choosing
    12. Add a Variance like -/+ 30% to add some random chance
    13. save the actor that did the skill check name as a variable.
    14. [SIZE=26px]How to Use[/SIZE]
    15. To use this Script you use a single Plugin Command Which is Chk_Stat, where stat can be atk, def, mat, mdf, agi, or luk.
    16. This will set the variable you have selected (Default 45) to the Highest value among your party to that Stat.
    17. Also if you wanna add some variance just add a number to the end of the command. ie Chk_atk 45 will give you the highest atk
    18. stat in your party +/- 45% and save it to the selected variable.
    19. [SIZE=28px]Demo[/SIZE]
    20. Dont think this needs one but i will put if it becomes needed
    21. Script
    复制代码


    Spoiler                Code:       
    1. var params = PluginManager.parameters("SkillCheck");
    2. /*:
    3. *@param Varsav
    4. *@desc The Variable to Save the Stat Check to
    5. *@default 45
    6. *
    7. *
    8. *@param NameSav
    9. *@desc The Vaiable to save the name of the actor who attempted the skill check.
    10. *@default 46
    11. */
    12. var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;
    13. var Varsav = Number(params["Varsav"]|| 45);
    14. var NameSav = Number(params["NameSav"]|| 46);
    15. Game_Interpreter.prototype.pluginCommand = function(command, args){
    16.         aliasPluginCommand.call(this,command, args);
    17.    var Size = $gameParty.members().length;
    18.         var m =0;
    19.     var x = 0;
    20.     var name = null;
    21.         if(command == "Chk_atk"){
    22.         
    23.         while(x<Size){
    24.             if($gameParty.members()[x].atk>m){
    25.                 m=$gameParty.members()[x].atk;
    26.                   name = $gameParty.members()[x].actorId();
    27.                
    28.             }
    29.        x++
    30.    
    31.         }
    32.      
    33.     }
    34.        
    35.        
    36.         if(command == "Chk_def"){
    37.         while(x<Size){
    38.             if($gameParty.members()[x].def>m){
    39.                 m=$gameParty.members()[x].def;
    40.                   name = $gameParty.members()[x].actorId();
    41.             }
    42.        x++ }
    43. }
    44.        
    45.         if(command == "Chk_mat"){
    46.        while(x<Size){
    47.             if($gameParty.members()[x].mat>m){
    48.                 m=$gameParty.members()[x].mat;
    49.                   name = $gameParty.members()[x].actorId();
    50.             }
    51.        x++ }
    52. }
    53.                
    54.         if(command == "Chk_mdf"){
    55.         while(x<Size){
    56.             if($gameParty.members()[x].mdf>m){
    57.                 m=$gameParty.members()[x].mdf;
    58.                   name = $gameParty.members()[x].actorId();
    59.             }
    60.        x++ }
    61. }
    62.                
    63.                 if(command == "Chk_agi"){
    64. while(x<Size){
    65.             if($gameParty.members()[x].agi>m){
    66.                 m=$gameParty.members()[x].agi;
    67.                   name = $gameParty.members()[x].actorId(); }
    68.        x++ }}
    69.         if(command == "Chk_luk"){
    70. while(x<Size){
    71.             if($gameParty.members()[x].luk>m){
    72.                 m=$gameParty.members()[x].luk;
    73.                   name = $gameParty.members()[x].actorId(); }
    74.        x++ }}
    75.     if(args[0]>0){
    76.        var High = Math.floor((args[0]/100)*m);
    77.        var Low = Math.floor((args[0]/100)*-m);
    78.     m += Math.floor(Math.random()*((High)-(Low)+1)+(Low));}
    79.   
    80.     console.log(name)
    81.     $gameVariables.setValue(Varsav, m);
    82.     $gameVariables.setValue(NameSav, $gameActors.actor(name).name());
    83.    
    84. }
    复制代码





                    Code:       
    1. [SIZE=28px]FAQ
    2. [/SIZE][SIZE=12px]Q: A am getting a cannot read the property of null error
    3. A: The plugin command is case sensitive please insure that the command read "Chk_stat" where stat is the 3 letter abbreviation for the stat in all lower case letters. [/SIZE]
    4.  
    复制代码




    本贴来自国际rpgmaker官方论坛作者:forteller处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/simple-skill-check.68564/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 03:54 , Processed in 0.089561 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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