设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1264|回复: 4
打印 上一主题 下一主题

怎么做个每回合恢复HP的药?

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-11
帖子
50
跳转到指定楼层
1
发表于 2008-5-22 17:29:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv3.寻梦者

酱油的

梦石
0
星屑
1265
在线时间
2161 小时
注册时间
2007-12-22
帖子
3271

贵宾

2
发表于 2008-5-22 17:34:36 | 只看该作者
方法不一定最好,不過可以一試。
那個 RECOVERY 是腳本調用開關

  1. RECOVERY = true
  2. if RECOVERY
  3. #==============================================================================
  4. # ■ Scene_Battle (分割定义 4)
  5. #------------------------------------------------------------------------------
  6. #  处理战斗画面的类。
  7. #==============================================================================

  8. class Scene_Battle
  9.   #--------------------------------------------------------------------------
  10.   # ● 行動前效果追加
  11.   #--------------------------------------------------------------------------
  12.   def pre_effect(battler)
  13.     # HP回復小(1/10之恢复)
  14.     if battler.state?(26) and battler.hp >0  #-生命恢复
  15.       battler.hp_recover_effect( 1/10 )
  16.       battler.damage_pop["hp_plus"] = true
  17.     end
  18.     # SP回復小(1/10之恢复)
  19.     if battler.state?(27) and battler.hp >0  #-SP恢復
  20.       battler.sp_recover_effect( 1/10 )
  21.       battler.damage_pop["sp_plus"] = true
  22.     end
  23.     # HP傷害小(1/10之伤害)
  24.     if battler.state?(28) and battler.hp >0  #-生命傷害
  25.       battler.hp_recover_effect( -1/10 )
  26.       battler.damage_pop["hp_plus"] = true
  27.     end
  28.     # SP傷害小(1/10之伤害)
  29.     if battler.state?(29) and battler.hp >0  #-SP傷害
  30.       battler.sp_recover_effect( -1/10 )
  31.       battler.damage_pop["sp_plus"] = true
  32.     end
  33.   end
  34. end
  35. class Game_Battler
  36.   #--------------------------------------------------------------------------
  37.   # ● 自動復元方法
  38.   #--------------------------------------------------------------------------
  39. # HP  =========================================================================
  40.   def hp_common
  41.     # 分散
  42.     if self.damage["hp_plus"].abs > 0
  43.       amp = [self.damage["hp_plus"].abs * 15 / 100, 1].max
  44.       self.damage["hp_plus"] += rand(amp+1) + rand(amp+1) - amp
  45.     end
  46.     # HP からダメージを減算
  47.     self.hp -= self.damage["hp_plus"]
  48.   end
  49.   def hp_recover_effect(quantity)
  50.     a = quantity
  51.     if a > 1 or a < -1
  52.       # 定量恢复
  53.       # ダメージを設定
  54.       self.damage["hp_plus"] = (-a)
  55.     else
  56.       # 倍率恢复
  57.       # ダメージを設定
  58.       self.damage["hp_plus"] = self.maxhp * (-a)
  59.     end
  60.     # 分散 and 減算
  61.     hp_common
  62.     # メソッド終了
  63.     return true
  64.   end
  65. # SP  =========================================================================
  66.   def sp_common
  67.     # 分散
  68.     if self.damage_sp["sp_plus"].abs > 0
  69.       amp = [self.damage_sp["sp_plus"].abs * 15 / 100, 1].max
  70.       self.damage_sp["sp_plus"] += rand(amp+1) + rand(amp+1) - amp
  71.     end
  72.     # HP からダメージを減算
  73.     self.sp -= self.damage_sp["sp_plus"]
  74.   end
  75.   def sp_recover_effect(quantity)
  76.     a = quantity
  77.     if a > 1 or a < -1
  78.       # 定量恢复
  79.       # ダメージを設定
  80.       self.damage["sp_plus"] = (-a)
  81.     else
  82.       # 倍率恢复
  83.       # ダメージを設定
  84.       self.damage["sp_plus"] = self.maxsp * (-a)
  85.     end
  86.     # 分散 and 減算
  87.     sp_common
  88.     # メソッド終了
  89.     return true
  90.   end
  91. end

  92. #----------------------------------------------------------------------------
  93. # ● 召喚原方法
  94. #----------------------------------------------------------------------------
  95. class Scene_Battle
  96.   #--------------------------------------------------------------------------
  97.   # ● リフレッシュ
  98.   #--------------------------------------------------------------------------
  99.   def refresh_phase(battler)
  100.     battler.at -= @max
  101.     if battler.movable?
  102.       battler.atp = 100 * battler.at / @max
  103.     end
  104.     spell_reset(battler)
  105.     # スリップダメージ
  106.     if battler.hp > 0 and battler.slip_damage?
  107.       battler.slip_damage_effect
  108.       battler.damage_pop["slip"] = true
  109.     end
  110. # 行動前效果追加
  111.     pre_effect(battler)
  112. # 完了
  113.     # ステート自然解除
  114.     battler.remove_states_auto
  115.     # ステータスウィンドウをリフレッシュ
  116.     status_refresh(battler, true)
  117.     unless battler.movable?
  118.       return
  119.     end
  120.     # ターン数カウント
  121.     @turn_cnt += 1
  122.   end
  123. end
  124. end
复制代码
不做頭像做簽名,看我囧冏有神(多謝山人有情提供 )
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-11
帖子
50
3
 楼主| 发表于 2008-5-22 17:53:40 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

酱油的

梦石
0
星屑
1265
在线时间
2161 小时
注册时间
2007-12-22
帖子
3271

贵宾

4
发表于 2008-5-22 18:09:06 | 只看该作者
main之前 RTAB之後啊...自己要多點嘗試才行咩
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
不做頭像做簽名,看我囧冏有神(多謝山人有情提供 )
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-11
帖子
50
5
 楼主| 发表于 2008-5-22 18:19:58 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-31 06:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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