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

[转载发布] KBribe XP

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

    连续签到: 2 天

    [LV.7]常住居民III

    4461

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 18:13 | 显示全部楼层 |阅读模式
    KBribe XP

    by Kyonides Arkanthes


    Introduction

    Admit it, there are times when you wish that you could simply bribe your foes during battle.
    Well, now you can do it!

    Oh and it is also possible to get an estimate of how much it might cost you!


    By the way, it is not a Plug & Play script because you can customize several things like where to show the currency symbol, etc. So do not forget to check out the KBribe module, guys!


    The Script

                    Code:        
    1. # * KBribe XP
    2. #   Scripter : Kyonides Arkanthes
    3. #   v1.0.0 - 2022-07-14
    4. # * Non Plug & Play Script * #
    5. # Now you can bribe your foes during battles!
    6. # You can learn how much it might cost the party to bribe a given foe.
    7. # Just check out the skill description to find it out. ;)
    8. # It is also possible to exclude certain monsters like bosses if needed.
    9. # In the KBribe module you can find several CONSTANTS where you can set the
    10. # initial values for the hit rate, damage percent, etc.
    11. # * Script Calls * #
    12. # $game_party.bribe_hit = Percent
    13. # $game_party.bribe_gold_percent = Percent
    14. # $game_party.bribe_dmg_percent = Percent
    15. # $game_party.bribe_gold_min = Coins
    16. # $game_party.bribe_show_dmg_pop = true  or  false
    17. module KBribe
    18.   SKILL_ID = 81
    19.   # Bribing Hero's Failure Animation
    20.   ANIMATION_ID = 101
    21.   START_HIT_RATE = 33
    22.   START_GOLD_PERCENT = 5
    23.   FAILURE_DMG_PERCENT = 25
    24.   GOLD_MIN = 50
    25.   SHOW_DMG_POP_UP = true
    26.   CURRENCY_SYMBOL_FIRST = false
    27.   SKILL_COST_TEXT = "Est. Cost: "
    28.   SUCCESS_LABEL = "Bribed"
    29.   # Add as many MonsterID's as needed
    30.   EXCLUDE_BOSSES = []
    31.   extend self
    32.   @battlers = []
    33.   @escaped = []
    34.   def add(battler, do_escape)
    35.     @battlers << battler
    36.     @escaped << do_escape
    37.   end
    38.   def battlers_reaction
    39.     @battlers.each do |btlr|
    40.       btlr.animation_id = ANIMATION_ID
    41.       btlr.animation_hit = true
    42.     end
    43.   end
    44.   def hurt!
    45.     @battlers.size.times do |n|
    46.       btlr = @battlers[n]
    47.       btlr.damage_pop = $game_party.bribe_show_dmg_pop
    48.       btlr.escape if @escaped[n]
    49.     end
    50.     @battlers.clear
    51.     @escaped.clear
    52.   end
    53.   def skill_description
    54.     text = " " + KBribe::SKILL_COST_TEXT
    55.     if CURRENCY_SYMBOL_FIRST
    56.       text += $data_system.words.gold + @amount.to_s
    57.     else
    58.       text += @amount.to_s + $data_system.words.gold
    59.     end
    60.   end
    61.   def set_bribe_estimate() @amount = $game_party.calculate_bribe end
    62.   def exclude?(mob_id) !EXCLUDE_BOSSES.include?(mob_id) end
    63. end
    64. class Game_Party
    65.   alias :kyon_bribe_gm_pty_init :initialize
    66.   def initialize
    67.     kyon_bribe_gm_pty_init
    68.     @bribe_hit = KBribe::START_HIT_RATE
    69.     @bribe_gold_percent = KBribe::START_GOLD_PERCENT
    70.     @bribe_dmg_percent = KBribe::FAILURE_DMG_PERCENT
    71.     @bribe_gold_min = KBribe::GOLD_MIN
    72.     @bribe_show_dmg_pop = KBribe::SHOW_DMG_POP_UP
    73.   end
    74.   def calculate_bribe
    75.     amount = (@gold / 100 * @bribe_gold_percent).round
    76.     amount += amount * (rand(25) + 1) / 100
    77.   end
    78.   def pay_bribe!
    79.     return false if @bribe_gold_min > @gold
    80.     amount = calculate_bribe
    81.     lose_gold(amount)
    82.     true
    83.   end
    84.   attr_accessor :bribe_hit, :bribe_gold_percent
    85.   attr_accessor :bribe_dmg_percent, :bribe_gold_min, :bribe_show_dmg_pop
    86. end
    87. class Game_Battler
    88.   alias :kyon_bribe_gm_btlr_skill_fx :skill_effect
    89.   def check_bribe(user)
    90.     hit = $game_party.pay_bribe!
    91.     hit |= rand(100) < $game_party.bribe_hit
    92.     hit |= KBribe.exclude?(@enemy_id)
    93.     if hit
    94.       KBribe.add(self, hit)
    95.       @damage = KBribe::SUCCESS_LABEL
    96.     else
    97.       user.damage = (user.hp / 100 * $game_party.bribe_dmg_percent).round
    98.       user.hp -= user.damage
    99.     end
    100.   end
    101.   def skill_effect(user, skill)
    102.     return check_bribe(user) if self.enemy? and KBribe::SKILL_ID == skill.id
    103.     kyon_bribe_gm_btlr_skill_fx(user, skill)
    104.   end
    105.   def actor?() @actor_id != nil end
    106.   def enemy?() @enemy_id != nil end
    107. end
    108. class Window_Skill
    109.   def update_help
    110.     a_skill = self.skill
    111.     if a_skill.nil?
    112.       @text = ""
    113.     else
    114.       @text = a_skill.description.dup
    115.       @text += KBribe.skill_description if KBribe::SKILL_ID == a_skill.id
    116.     end
    117.     return if @text == @last_text
    118.     @help_window.set_text(@text)
    119.     @last_text = @text
    120.   end
    121. end
    122. class Scene_Battle
    123.   alias :kyon_backfire_scn_btl_start_skill_sel :start_skill_select
    124.   alias :kyon_backfire_scn_btl_up_ph4_s4 :update_phase4_step4
    125.   alias :kyon_backfire_scn_btl_up_ph4_s5 :update_phase4_step5
    126.   def start_skill_select
    127.     kyon_backfire_scn_btl_start_skill_sel
    128.     KBribe.set_bribe_estimate
    129.   end
    130.   def update_phase4_step4
    131.     kyon_backfire_scn_btl_up_ph4_s4
    132.     KBribe.battlers_reaction
    133.   end
    134.   def update_phase4_step5
    135.     kyon_backfire_scn_btl_up_ph4_s5
    136.     KBribe.hurt!
    137.   end
    138. end
    复制代码




    Terms & Conditions

    Include my nickname in your game credits!

    Free for use in non commercial games.
    Contact me if you want to go commercial.
    It is an inexpensive script so you do not have to worry about this.



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 16:52 , Processed in 0.067611 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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