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

[转载发布] KPermaDamage VX

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

    连续签到: 2 天

    [LV.7]常住居民III

    4446

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    KPermaDamage VX

    by Kyonides Arkanthes



    Introduction

    Would Ralph love to lose n amount of HP or MP every time he moves in any direction?
    Well, now he gotta live with it if he does and it happens to have the death sentence already configured in the KPermaDmg module.

    Plus, he could also die if his MP goes kaboom. :S
    And there is also the dreadful perma-death. :S

    Read the notes on how to configure the CONSTANTS that will affect the target Actors.

    FAQ

    Question:
    Isn't that redundant or unnecessary?
    Answer: Who cares?


                    Ruby:        
    1. # * KPermaDamage VX * #
    2. #   Scripter : Kyonides Arkanthes
    3. #   v1.0.1 - 2023-02-04
    4. # Make certain Heroes permanently lose HP or MP or even collapse for having
    5. # no more MP left!
    6. # * CONSTANTS * #
    7. # LOSE_HP or LOSE_MP or MP_DEATH or PERMA_DEATH
    8. # The only way to cure the permanent HP or MP damage or the MP Death would be
    9. # the following Script Calls:
    10. # $game_actors[ActorID].perma_hp_dmg = 0
    11. # $game_actors[ActorID].perma_mp_dmg = 0
    12. # $game_actors[ActorID].mp_death = nil
    13. # $game_actors[ActorID].perma_death = nil
    14. module KPermaDmg
    15.   # ActorID => Points Lost, etc. separated by a commas
    16.   LOSE_HP = { 1 => 5 }
    17.   LOSE_MP = { 1 => 3 }
    18.   # Just Add as Many ActorIDs as deemed necessary
    19.   MP_DEATH = [1]
    20.   PERMA_DEATH = []
    21. end
    22. class Game_Battler
    23.   alias :kyon_gm_btlr_hp_set :hp=
    24.   alias :kyon_gm_btlr_mp_set :mp=
    25.   alias :kyon_gm_btlr_rec_all :recover_all
    26.   def hp=(new_hp)
    27.     return 0 if @perma_death
    28.     kyon_gm_btlr_hp_set(new_hp)
    29.   end
    30.   def mp=(new_mp)
    31.     return 0 if @perma_death
    32.     kyon_gm_btlr_mp_set(new_mp)
    33.     check_mp_death if @mp_death
    34.   end
    35.   def recover_all
    36.     return if @perma_death
    37.     kyon_gm_btlr_rec_all
    38.   end
    39. end
    40. class Game_Actor
    41.   alias :kyon_gm_act_setup :setup
    42.   def setup(actor_id)
    43.     kyon_gm_act_setup(actor_id)
    44.     setup_permanent_damage
    45.   end
    46.   def setup_permanent_damage
    47.     @perma_hp_dmg = KPermaDmg::LOSE_HP[@actor_id] || 0
    48.     @perma_mp_dmg = KPermaDmg::LOSE_MP[@actor_id] || 0
    49.     @mp_death = KPermaDmg::MP_DEATH.include?(@actor_id)
    50.     @perma_death = KPermaDmg::PERMA_DEATH.include?(@actor_id)
    51.   end
    52.   def permanent_damage
    53.     self.hp -= @perma_hp_dmg
    54.     self.mp -= @perma_mp_dmg
    55.   end
    56.   def check_mp_death
    57.     if @mp == 0 and !@immortal
    58.       @hp = 0
    59.       add_state(1)
    60.       @added_states << 1
    61.     else
    62.       @hp = 1 if @hp == 0
    63.       remove_state(1)
    64.       @removed_states << 1
    65.     end
    66.   end
    67.   attr_accessor :perma_hp_dmg, :perma_mp_dmg, :mp_death, :perma_death
    68. end
    69. class Game_Party
    70.   def permanent_damage
    71.     @actors.each{|aid| $game_actors[aid].permanent_damage }
    72.   end
    73. end
    74. class Game_Player
    75.   alias :kyon_gm_plyr_incr_steps :increase_steps
    76.   def increase_steps
    77.     kyon_gm_plyr_incr_steps
    78.     $game_party.permanent_damage
    79.   end
    80. end
    复制代码




    Terms & Conditions

    Free as in beer.
    Include my nickname in your game credits.
    Do not repost it!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 14:20 , Processed in 0.064970 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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