赞 | 667 |
VIP | 62 |
好人卡 | 144 |
积分 | 334 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33425
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
唉~,已经帮了一次,第二次就顺手了- #==============================================================================
- class Game_Enemy < Game_Battler
- #精英怪使用的技能的开关标志,这个开关处于常闭状态,不需要打开,只是一个精英怪
- #特有技能的判断标志。在设置精英怪特有的行动技能时,勾选上该开关。
- SIGN_SWITCH_ID = 1
- #精英怪前缀名。
- PERFIX_NAME = "精英·"
- #--------------------------------------------------------------------------
- # ● 获取名称
- #--------------------------------------------------------------------------
- def name
- return is_by? ? PERFIX_NAME + $data_enemies[@enemy_id].name : $data_enemies[@enemy_id].name
- 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
- #===X☆R ====================================
- if switch_id != SIGN_SWITCH_ID or ! is_by?
- next if $game_switches[switch_id] == false
- end
- #============================================
- 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
- #==============================================================================
复制代码 |
|