| 赞 | 12 |
| VIP | |
| 好人卡 | |
| 积分 | 14 |
| 经验 | |
| 最后登录 | 2026-4-12 |
| 在线时间 | 185 小时 |
- 梦石
- 0
- 星屑
- 1397
- 在线时间
- 185 小时
- 注册时间
- 2007-2-28
- 回帖
- 139
|
发表于 2017-12-16 01:18:43
|
显示全部楼层
重写一个Window_Help类下的set_text方法,在Scene_Battle类下的make_skill_action_result中调用重写的方法就行了
- class Window_Help < Window_Base
- def set_text_bitmap(bitmap,text, align = 0)
- # 如果文本和对齐方式的至少一方与上次的不同
- if text != @text or align != @align
- # 再描绘文本
- self.contents.clear
- self.contents.font.color = normal_color
- #==========================================
- x= (self.width-self.contents.text_size(text).width)/2-44
- self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))
- #==========================================
- self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
- @text = text
- @align = align
- @actor = nil
- end
- self.visible = true
- end
- end
-
- class Scene_Battle
- def make_skill_action_result
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- #=======================================
- bitmap = RPG::Cache.icon(@skill.icon_name)
- @help_window.set_text_bitmap(bitmap,@skill.name, 1)
- #=======================================
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- end
复制代码
|
评分
-
查看全部评分
|