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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 鲔鱼吐司
打印 上一主题 下一主题

關於使用暗器的問題~!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
61
在线时间
24 小时
注册时间
2008-8-5
帖子
1924
11
发表于 2009-5-20 07:47:11 | 只看该作者
第二段腳本應該在前吧,將里面的 item_effect 改為:
def item_effect(item, user = nil)
   self.critical = false
   if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
      ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
     # 过程结束(effective = false)
     return false
   end
   effective = false
   effective |= item.common_event_id > 0
   hit_result = (rand(100) < item.hit)
   effective |= item.hit < 100
   if hit_result == true
     recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
     recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
     if recover_hp < 0
       recover_hp += self.pdef * item.pdef_f / 20
       recover_hp += self.mdef * item.mdef_f / 20
       recover_hp = [recover_hp, 0].min
     end
     recover_hp *= elements_correct(item.element_set)
     recover_hp /= 100
     recover_sp *= elements_correct(item.element_set)
     recover_sp /= 100
     if item.variance > 0 and recover_hp.abs > 0
       amp = [recover_hp.abs * item.variance / 100, 1].max
       recover_hp += rand(amp+1) + rand(amp+1) - amp
     end
     if item.variance > 0 and recover_sp.abs > 0
       amp = [recover_sp.abs * item.variance / 100, 1].max
       recover_sp += rand(amp+1) + rand(amp+1) - amp
     end
     if recover_hp < 0
       # 10 号防具装备时投掷伤害变为 5 倍
       if user.class == Game_Actor && (user.armor1_id == 10 ||
         user.armor2_id == 10 || user.armor3_id == 10 ||
         user.armor4_id == 10)
         recover_hp *= 5
       end

       if self.guarding?
         recover_hp /= 2
       end
     end
     self.damage = -recover_hp
     last_hp = self.hp
     last_sp = self.sp
     self.hp += recover_hp
     self.sp += recover_sp
     if recover_sp != 0
     self.damage = -recover_sp
     end
     effective |= self.hp != last_hp
     effective |= self.sp != last_sp
     @state_changed = false
     effective |= states_plus(item.plus_state_set)
     effective |= states_minus(item.minus_state_set)
     if item.parameter_type > 0 and item.parameter_points != 0
       case item.parameter_type
       when 1
         @maxhp_plus += item.parameter_points
       when 2
         @maxsp_plus += item.parameter_points
       when 3
         @str_plus += item.parameter_points
       when 4
         @dex_plus += item.parameter_points
       when 5
         @agi_plus += item.parameter_points
       when 6
         @int_plus += item.parameter_points
       end
       effective = true
     end
     if item.recover_hp_rate == 0 and item.recover_hp == 0 and item.recover_sp_rate == 0 and item.recover_sp == 0
       self.damage = ""
       if item.recover_sp_rate == 0 and item.recover_sp == 0 and
          (item.parameter_type == 0 or item.parameter_points == 0)
         unless @state_changed
           self.damage = "Miss"
         end
       end
     end
   else
     self.damage = "Miss"
   end
   unless $game_temp.in_battle
     self.damage = nil
   end
   # 血玲珑
   if item.element_set.include?(hp_storage_id)
     self.damage = nil
     differ_hp = self.maxhp - self.hp
     if $game_variables[STORAGE::HP_VAR] > differ_hp
       $game_variables[STORAGE::HP_VAR] -= differ_hp
       self.damage = -differ_hp if differ_hp !=0
       self.hp = self.maxhp
     else
       self.damage = -$game_variables[STORAGE::HP_VAR] if $game_variables[STORAGE::HP_VAR] != 0
       self.hp += $game_variables[STORAGE::HP_VAR]
       $game_variables[STORAGE::HP_VAR] = 0
     end
     num = $game_party.item_number(item.id)
     num_remain = [1 + $game_variables[STORAGE::HP_VAR] / STORAGE::HP_MAX, num].min
     num_costed = num - num_remain
     if $game_variables[STORAGE::HP_VAR] == 0
       num_costed = num
     end
     $game_party.gain_storage(item.id, -num_costed)
     effective |= differ_hp > 0
   end
   # 法玲珑
   if item.element_set.include?(sp_storage_id)
     self.damage = nil
     differ_sp = self.maxsp - self.sp
     if $game_variables[STORAGE::SP_VAR] > differ_sp
       $game_variables[STORAGE::SP_VAR] -= differ_sp
       self.damage = -differ_sp if differ_sp != 0
       self.sp = self.maxsp
     else
       self.damage = -$game_variables[STORAGE::SP_VAR] if $game_variables[STORAGE::SP_VAR] != 0
       self.sp += $game_variables[STORAGE::SP_VAR]
       $game_variables[STORAGE::SP_VAR] = 0
     end
     num = $game_party.item_number(item.id)
     num_remain = [1 + $game_variables[STORAGE::SP_VAR] / STORAGE::SP_MAX, num].min
     num_costed = num - num_remain
     if $game_variables[STORAGE::SP_VAR] == 0
       num_costed = num
     end
     $game_party.gain_storage(item.id, -num_costed)
     effective |= differ_sp > 0
   end
   # 过程结束
   return effective
end
end

然后把第一段腳本的 item_effect 改為:
def item_effect(item, user = nil)
  if self.is_a?(Game_Actor) and self.name.include?("幻影")
    self.damage = "False"
    return
  end
  ac_item_effect(item, user)
end
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-1-15 06:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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