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

[转载发布] KBareHands XP

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

    连续签到: 2 天

    [LV.7]常住居民III

    4469

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 09:25 | 显示全部楼层 |阅读模式
    KBareHands XP
    v1.0.2

    by Kyonides Arkanthes



    Introduction

    This scriptlet lets you add base attack, physical and magical defense to any hero. It could be especially useful for barehanded martial artists.

    Those stats might also get increased per every level the hero gains. They can be increased or decreased by using script calls.

    If you ever consider that to be pretty boring, then let me tell you that you got an alternative, namely the "Preferred Stat" option!

    It will add the totals of all 3 stats to the preferred one while the others get no boost at all. This can be altered in game at any given time.

    There are also the Base Stat and Stat Increase Lottos!

    A given stat might get an increase or decrease depending on your luck.

    Take into consideration that you need to configure several Constants found in the module below or you could just set the generic default values there and take care of the rest in game via calling the script...

    You can also seal and unlock an hero's preferred stat.

    There is no screenshot for obvious reasons.  


    The Script


                    Code:        
    1. # * KBareHands XP
    2. #   Scripter : Kyonides Arkanthes
    3. #   2021-09-02 - v1.0.2
    4. #   Not a Plug & Play Script!
    5. # This scriptlet lets you add base attack, physical and magical defense to any
    6. # hero. It could be especially useful for barehanded martial artists.
    7. # Those stats might also get increased per every level the hero gains.
    8. # They can be increased or decreased by using script calls.
    9. # If you ever consider that to be pretty boring, then let me tell you that you
    10. # got an alternative, namely the "Preferred Stat" option!
    11. # It will add the totals of all 3 stats to the preferred one while the others
    12. # get no boost at all. This can be altered in game at any given time.
    13. # There are also the Base Stat and Stat Increase Lottos!
    14. # A given stat might get an increase or decrease depending on your luck.
    15. # Take into consideration that you need to configure several Constants found in
    16. # the module below or you could just set the generic default values there and
    17. # take care of the rest in game via calling the script...
    18. # * Aliased Methods * #
    19. # Game_Actor#base_atk
    20. # Game_Actor#base_pdef
    21. # Game_Actor#base_mdef
    22. # Stat stands for either :atk or :pdef or :mdef
    23. # PreferredStat stands for either nil or :atk or :pdef or :mdef
    24. # * Script Calls * #
    25. # Set Bare Hands Preferred Stat In Game
    26. # $game_actors[ActorID].prefer_stat = PreferredStat
    27. # Seal or Unseal Bare Hands Preferred Stat In Game
    28. # $game_actors[ActorID].seal_stat = true or false
    29. # Set Bare Hands Stat In Game
    30. # $game_actors[ActorID].hands_stat[Stat] = Number
    31. # $game_actors[ActorID].hands_atk = Number
    32. # $game_actors[ActorID].hands_pdef = Number
    33. # $game_actors[ActorID].hands_mdef = Number
    34. # Set Bare Hands Increase In Game
    35. # $game_actors[ActorID].hands_step[Stat] = Number
    36. # $game_actors[ActorID].step_atk = Number
    37. # $game_actors[ActorID].step_pdef = Number
    38. # $game_actors[ActorID].step_mdef = Number
    39. # Bare Hands Stat Lotto ( Between -50% and +50% )
    40. # $game_actors[ActorID].hands_stat_lotto(Stat)
    41. # Bare Hands Increase Lotto ( Between -50% and +50% )
    42. # $game_actors[ActorID].hands_step_lotto(Stat)
    43. module KBareHands
    44.   # Better leave the following 4 lines alone!
    45.   PREFERRED_STAT = {}
    46.   BASE_ATTACK = {}
    47.   BASE_PDEF = {}
    48.   BASE_MDEF = {}
    49.   # Base Stat and Increase per Level for Actors not listed below
    50.   PREFERRED_STAT.default = nil # Options: nil, :atk, :pdef, :mdef
    51.   BASE_ATTACK.default = [5, 2]
    52.   BASE_PDEF.default = [5, 2]
    53.   BASE_MDEF.default = [5, 2]
    54.   # [ActorID] = nil or :atk or :pdef or :mdef
    55.   PREFERRED_STAT[1] = :pdef
    56.   # [ActorID] = [Base Attack, Increase]
    57.   BASE_ATTACK[1] = [6, 3]
    58.   # [ActorID] = [Base PDEF, Increase]
    59.   BASE_PDEF[1] = [6, 3]
    60.   # [ActorID] = [Base MDEF, Increase]
    61.   BASE_MDEF[1] = [6, 3]
    62. end
    63. class Game_Actor
    64.   alias :kyon_hands_gm_actor_setup :setup
    65.   alias :kyon_hands_gm_actor_base_atk :base_atk
    66.   alias :kyon_hands_gm_actor_base_pdef :base_pdef
    67.   alias :kyon_hands_gm_actor_base_mdef :base_mdef
    68.   def setup(actor_id)
    69.     kyon_hands_gm_actor_setup(actor_id)
    70.     bsatk, incr = KBareHands::BASE_ATTACK[actor_id]
    71.     bpdef, pinc = KBareHands::BASE_PDEF[actor_id]
    72.     bmdef, minc = KBareHands::BASE_MDEF[actor_id]
    73.     @hands_stats = { :atk => bsatk, :pdef => bpdef, :mdef => bmdef }
    74.     @hands_step = { :atk => incr, :pdef => pinc, :mdef => minc }
    75.     @prefer_stat = KBareHands::PREFERRED_STAT[actor_id]
    76.   end
    77.   
    78.   def hands_stat_lotto(key)
    79.     stat = @hands_stats[key]
    80.     @hands_stats[key] = stat / 2 + rand(stat + 1)
    81.   end
    82.   
    83.   def hands_step_lotto(key)
    84.     stat = @hands_step[key]
    85.     @hands_step[key] = stat / 2 + rand(stat + 1)
    86.   end
    87.   def bare_calc(stat)
    88.     if @prefer_stat == stat
    89.       st = @hands_stats.values.inject{|a,b| a + b }
    90.       st + @level * @hands_step.values.inject{|a,b| a + b }
    91.     elsif @prefer_stat == nil
    92.       @hands_stats[stat] + @hands_step[stat] * @level
    93.     else
    94.       0
    95.     end
    96.   end
    97.   def base_atk
    98.     kyon_hands_gm_actor_base_atk + barehands_calc(:atk)
    99.   end
    100.   def base_pdef
    101.     kyon_hands_gm_actor_base_pdef + barehands_calc(:pdef)
    102.   end
    103.   def base_mdef
    104.     kyon_hands_gm_actor_base_mdef + barehands_calc(:mdef)
    105.   end
    106.   def prefer_stat=(stat) @prefer_stat = @seal_stat ? @prefer_stat : stat  end
    107.   def hands_atk() @hands_stats[:atk] end
    108.   def hands_pdef() @hands_stats[:pdef] end
    109.   def hands_mdef() @hands_stats[:mdef] end
    110.   def hands_atk=(n) @hands_stats[:atk] = n end
    111.   def hands_pdef=(n) @hands_stats[:pdef] = n end
    112.   def hands_mdef=(n) @hands_stats[:mdef] = n end
    113.   def step_atk() @hands_step[:atk] end
    114.   def step_pdef() @hands_step[:pdef] end
    115.   def step_mdef() @hands_step[:mdef] end
    116.   def step_atk=(n) @hands_step[:atk] = n end
    117.   def step_pdef=(n) @hands_step[:pdef] = n end
    118.   def step_mdef=(n) @hands_step[:mdef] = n end
    119.   attr_reader :hands_stats, :hands_step, :prefer_stat
    120.   attr_accessor :seal_stat
    121. end
    122. class Game_Actors
    123.   def initialize
    124.     $data_weapons[0] = RPG::Weapon.new
    125.     $data_armors[0] = RPG::Armor.new
    126.     @data = []
    127.   end
    128. end
    复制代码



    Terms & Conditions

    Feel free to use it anywhere but not as a punch bag.
    Include me in your game credits!
    Do not repost this script!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 17:53 , Processed in 0.142572 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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