查看: 4673|回复: 2

[已经解决] 求教一下一个技能既消耗TP又消耗MP怎么显示?

[复制链接]
梦石
0
星屑
809
在线时间
176 小时
注册时间
2017-1-15
回帖
50
发表于 2020-11-19 07:01:52 | 显示全部楼层 |阅读模式
悬赏50星屑已解决
一个技能比方消耗10TP 20MP,在默认工程的技能列表里只能看到消耗TP或者MP,不能同时看到两者,这个问题怎么解决?

最佳答案

查看完整内容

[pre lang="ruby"]class Window_SkillList < Window_Selectable #-------------------------------------------------------------------------- # ● 绘制技能的使用消耗 #-------------------------------------------------------------------------- def draw_skill_cost(rect, skill) if @actor.skill_tp_cost(skill) > 0 change_color(tp_cost_color) draw_text(rect, @actor.skill_tp_cost(skill), ...
梦石
0
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-11-19 07:01:53 | 显示全部楼层
  1. class Window_SkillList < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 绘制技能的使用消耗
  4.   #--------------------------------------------------------------------------
  5.   def draw_skill_cost(rect, skill)
  6.     if @actor.skill_tp_cost(skill) > 0
  7.       change_color(tp_cost_color)
  8.       draw_text(rect, @actor.skill_tp_cost(skill), 2)
  9.       rect.x -= 32
  10.     end
  11.     if @actor.skill_mp_cost(skill) > 0
  12.       change_color(mp_cost_color)
  13.       draw_text(rect, @actor.skill_mp_cost(skill), 2)
  14.     end
  15.   end
  16. end
复制代码

点评

谢谢~  发表于 2020-11-19 19:26
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部