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

Project1

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

[已经过期] 魔力宝贝1.20解密版本里面怪物的强度问题以及脚本设置

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
139
在线时间
7 小时
注册时间
2011-10-6
帖子
1
跳转到指定楼层
1
发表于 2011-10-6 15:02:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
魔力宝贝1.20的XP版本解密版,
其中的Game_Enemy脚本中,设置太变态了。。我不会自己修改,想询问高手修改方式!
以下是代码

里面的自动获取HP,SP什么的里面的  return ($data_enemies[@enemy_id].maxhp + $a1+$i)* $enelv 这句,+$a1+$i是什么意思?要设置具体数值在哪里?
最后我还想询问一下敌人的等级在什么地方设置?我有个敌人等级随玩家变化而变化的设置脚本,但是不会用。。有需要的人我可以把那个脚本发上来!以上


#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
#  处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的
# 内部使用。
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     troop_id     : 循环 ID
  #     member_index : 循环成员的索引
  #--------------------------------------------------------------------------
  def initialize(troop_id, member_index)
    super()
    @troop_id = troop_id
    @member_index = member_index
    troop = $data_troops[@troop_id]
    @enemy_id = troop.members[@member_index].enemy_id
    enemy = $data_enemies[@enemy_id]
    if enemy.gold != 0
      $enelv = enemy.gold
    else
      $enelv = 1
    end
   
    @battler_name = enemy.battler_name
    @battler_hue = enemy.battler_hue
    @hp = maxhp
    @sp = maxsp
    @hidden = troop.members[@member_index].hidden
    @immortal = troop.members[@member_index].immortal
  end

  #--------------------------------------------------------------------------
  # ● 获取敌人 ID
  #--------------------------------------------------------------------------
  def id
    return @enemy_id
  end
  #--------------------------------------------------------------------------
  # ● 获取索引
  #--------------------------------------------------------------------------
  def index
    return @member_index
  end
  #--------------------------------------------------------------------------
  # ● 获取名称
  #--------------------------------------------------------------------------
  def name
    return $data_enemies[@enemy_id].name
  end
  #--------------------------------------------------------------------------
  # ● 获取基本 MaxHP
  #--------------------------------------------------------------------------
  def base_maxhp
   
    case @member_index
    when 0
    return ($data_enemies[@enemy_id].maxhp + $a1+$i)* $enelv
    when 1
    return ($data_enemies[@enemy_id].maxhp + $b+$i)* $enelv
    when 2
    return ($data_enemies[@enemy_id].maxhp + $c+$i)* $enelv
    when 3
    return ($data_enemies[@enemy_id].maxhp + $d+$i)* $enelv
    when 4
    return ($data_enemies[@enemy_id].maxhp + $e+$i)* $enelv
    when 5
    return ($data_enemies[@enemy_id].maxhp + $f+$i)* $enelv
    when 6
    return ($data_enemies[@enemy_id].maxhp + $g+$i)* $enelv
    when 7
    return ($data_enemies[@enemy_id].maxhp + $h+$i)* $enelv
    end
   
  end
  #--------------------------------------------------------------------------
  # ● 获取基本 MaxSP
  #--------------------------------------------------------------------------
  def base_maxsp
   
    case @member_index
    when 0
    return ($data_enemies[@enemy_id].maxsp + $a1+$i)* $enelv
    when 1
    return ($data_enemies[@enemy_id].maxsp + $b+$i)* $enelv
    when 2
    return ($data_enemies[@enemy_id].maxsp + $c+$i)* $enelv
    when 3
    return ($data_enemies[@enemy_id].maxsp + $d+$i)* $enelv
    when 4
    return ($data_enemies[@enemy_id].maxsp + $e+$i)* $enelv
    when 5
    return ($data_enemies[@enemy_id].maxsp + $f+$i)* $enelv
    when 6
    return ($data_enemies[@enemy_id].maxsp + $g+$i)* $enelv
    when 7
    return ($data_enemies[@enemy_id].maxsp + $h+$i)* $enelv
    end
   
  end
  #--------------------------------------------------------------------------
  # ● 获取基本力量
  #--------------------------------------------------------------------------
  def base_str
    case @member_index
    when 0
    return $data_enemies[@enemy_id].str + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].str + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].str + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].str + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].str + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].str + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].str + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].str + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本灵巧
  #--------------------------------------------------------------------------
  def base_dex
    case @member_index
    when 0
    return $data_enemies[@enemy_id].dex + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].dex + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].dex + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].dex + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].dex + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].dex + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].dex + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].dex + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本速度
  #--------------------------------------------------------------------------
  def base_agi
    case @member_index
    when 0
    return $data_enemies[@enemy_id].agi + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].agi + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].agi + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].agi + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].agi + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].agi + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].agi + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].agi + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本魔力
  #--------------------------------------------------------------------------
  def base_int
    case @member_index
    when 0
    return $data_enemies[@enemy_id].int + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].int + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].int + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].int + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].int + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].int + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].int + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].int + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本攻击力
  #--------------------------------------------------------------------------
  def base_atk
    case @member_index
    when 0
    return $data_enemies[@enemy_id].atk + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].atk + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].atk + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].atk + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].atk + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].atk + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].atk + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].atk + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本物理防御
  #--------------------------------------------------------------------------
  def base_pdef
    case @member_index
    when 0
    return $data_enemies[@enemy_id].atk + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].atk + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].atk + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].atk + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].atk + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].atk + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].atk + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].atk + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本魔法防御
  #--------------------------------------------------------------------------
  def base_mdef
    case @member_index
    when 0
    return $data_enemies[@enemy_id].mdef + $a1+$i+ $enelv
    when 1
    return $data_enemies[@enemy_id].mdef + $b+$i+ $enelv
    when 2
    return $data_enemies[@enemy_id].mdef + $c+$i+ $enelv
    when 3
    return $data_enemies[@enemy_id].mdef + $d+$i+ $enelv
    when 4
    return $data_enemies[@enemy_id].mdef + $e+$i+ $enelv
    when 5
    return $data_enemies[@enemy_id].mdef + $f+$i+ $enelv
    when 6
    return $data_enemies[@enemy_id].mdef + $g+$i+ $enelv
    when 7
    return $data_enemies[@enemy_id].mdef + $h+$i+ $enelv
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本回避修正
  #--------------------------------------------------------------------------
  def base_eva
    return $data_enemies[@enemy_id].eva
  end
  #--------------------------------------------------------------------------
  # ● 普通攻击 获取攻击方动画 ID
  #--------------------------------------------------------------------------
  def animation1_id
    return $data_enemies[@enemy_id].animation1_id
  end
  #--------------------------------------------------------------------------
  # ● 普通攻击 获取对像方动画 ID
  #--------------------------------------------------------------------------
  def animation2_id
    return $data_enemies[@enemy_id].animation2_id
  end
  #--------------------------------------------------------------------------
  # ● 获取属性修正值
  #     element_id : 属性 ID
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    # 获取对应属性有效度的数值
    table = [0,200,150,100,50,0,-100]
    result = table[$data_enemies[@enemy_id].element_ranks[element_id]]
    # 状态能防御本属性的情况下效果减半
    for i in @states
      if $data_states[i].guard_element_set.include?(element_id)
        result /= 2
      end
    end
    # 过程结束
    return result
  end
  #--------------------------------------------------------------------------
  # ● 获取属性有效度
  #--------------------------------------------------------------------------
  def state_ranks
    return $data_enemies[@enemy_id].state_ranks
  end
  #--------------------------------------------------------------------------
  # ● 属性防御判定
  #     state_id : 状态 ID
  #--------------------------------------------------------------------------
  def state_guard?(state_id)
    return false
  end
  #--------------------------------------------------------------------------
  # ● 获取普通攻击属性
  #--------------------------------------------------------------------------
  def element_set
    return []
  end
  #--------------------------------------------------------------------------
  # ● 获取普通攻击的状态变化 (+)
  #--------------------------------------------------------------------------
  def plus_state_set
    return []
  end
  #--------------------------------------------------------------------------
  # ● 获取普通攻击的状态变化 (-)
  #--------------------------------------------------------------------------
  def minus_state_set
    return []
  end
  #--------------------------------------------------------------------------
  # ● 获取行动
  #--------------------------------------------------------------------------
  def actions
    return $data_enemies[@enemy_id].actions
  end
  #--------------------------------------------------------------------------
  # ● 获取 EXP
  #--------------------------------------------------------------------------
  def exp
    return $data_enemies[@enemy_id].exp
  end
  #--------------------------------------------------------------------------
  # ● 获取金钱
  #--------------------------------------------------------------------------
  def gold
    return $data_enemies[@enemy_id].gold
  end
  #--------------------------------------------------------------------------
  # ● 获取物品 ID
  #--------------------------------------------------------------------------
  def item_id
    return $data_enemies[@enemy_id].item_id
  end
  #--------------------------------------------------------------------------
  # ● 获取武器 ID
  #--------------------------------------------------------------------------
  def weapon_id
    return $data_enemies[@enemy_id].weapon_id
  end
  #--------------------------------------------------------------------------
  # ● 获取放具 ID
  #--------------------------------------------------------------------------
  def armor_id
    return $data_enemies[@enemy_id].armor_id
  end
  #--------------------------------------------------------------------------
  # ● 获取宝物出现率
  #--------------------------------------------------------------------------
  def treasure_prob
    return $data_enemies[@enemy_id].treasure_prob
  end
  #--------------------------------------------------------------------------
  # ● 取得战斗画面 X 坐标
  #--------------------------------------------------------------------------
  def screen_x
    return $data_troops[@troop_id].members[@member_index].x
  end
  #--------------------------------------------------------------------------
  # ● 取得战斗画面 Y 坐标
  #--------------------------------------------------------------------------
  def screen_y
    return $data_troops[@troop_id].members[@member_index].y
  end
  #--------------------------------------------------------------------------
  # ● 取得战斗画面 Z 坐标
  #--------------------------------------------------------------------------
  def screen_z
    return screen_y
  end
  #--------------------------------------------------------------------------
  # ● 逃跑
  #--------------------------------------------------------------------------
  def escape
    # 设置击中标志
    @hidden = true
    # 清除当前行动
    self.current_action.clear
  end
  #--------------------------------------------------------------------------
  # ● 变身
  #     enemy_id : 变身为的敌人 ID
  #--------------------------------------------------------------------------
  def transform(enemy_id)
    # 更改敌人 ID
    @enemy_id = enemy_id
    # 更改战斗图形
    @battler_name = $data_enemies[@enemy_id].battler_name
    @battler_hue = $data_enemies[@enemy_id].battler_hue
    # 在生成行动
    make_action
  end
  #--------------------------------------------------------------------------
  # ● 生成行动
  #--------------------------------------------------------------------------
  def make_action
    # 清除当前行动
    self.current_action.clear
    # 无法行动的情况
    unless self.movable?
      # 过程结束
      return
    end
    # 抽取现在有效的行动
    available_actions = []
    rating_max = 0
    for action in self.actions
      # 确认回合条件
      n = $game_temp.battle_turn
      a = action.condition_turn_a
      b = action.condition_turn_b
      if (b == 0 and n != a) or
         (b > 0 and (n < 1 or n < a or n % b != a % b))
        next
      end
      # 确认 HP 条件
      if self.hp * 100.0 / self.maxhp > action.condition_hp
        next
      end
      # 确认等级条件
      if $game_party.max_level < action.condition_level
        next
      end
      # 确认开关条件
      switch_id = action.condition_switch_id
      if switch_id > 0 and $game_switches[switch_id] == false
        next
      end
      # 符合条件 : 添加本行动
      available_actions.push(action)
      if action.rating > rating_max
        rating_max = action.rating
      end
    end
    # 最大概率值作为 3 合计计算(0 除外)
    ratings_total = 0
    for action in available_actions
      if action.rating > rating_max - 3
        ratings_total += action.rating - (rating_max - 3)
      end
    end
    # 概率合计不为 0 的情况下
    if ratings_total > 0
      # 生成随机数
      value = rand(ratings_total)
      # 设置对应生成随机数的当前行动
      for action in available_actions
        if action.rating > rating_max - 3
          if value < action.rating - (rating_max - 3)
            self.current_action.kind = action.kind
            self.current_action.basic = action.basic
            self.current_action.skill_id = action.skill_id
            self.current_action.decide_random_target_for_enemy
            return
          else
            value -= action.rating - (rating_max - 3)
          end
        end
      end
    end
  end
end


wsx901123于2011-10-6 17:42补充以下内容:
求救啊……
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
136 小时
注册时间
2011-8-15
帖子
321
2
发表于 2011-10-6 18:17:53 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-23 19:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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