查看: 2526|回复: 1

[已经解决] 加点脚本字体大小

[复制链接]
梦石
0
星屑
600
在线时间
1118 小时
注册时间
2012-12-24
回帖
761
发表于 2014-2-7 21:34:05 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我用的是这个脚本
  1. #encoding:utf-8
  2. #=============================================================================
  3. #-----------RMVA加点系统正常向-v1.01---By:救世小树--------转载请注明出处-------
  4. #=============================================================================

  5. module Point_Tree
  6.   
  7.   POINT_VARIABLE = 33
  8.   POINT_KIND     = 7             #设定加点种类
  9.   #储存属性点的变量编号是33+角色id*(6+1),
  10.   #即40号变量为一号角色自由点;41号起6个变量为1号角色6个种类的已加点值
  11.   
  12.   LEVEL_UP_POINT = 3
  13.   #每升一级属性点增加数
  14.   
  15.   RESET_ITEM     = 20   #洗点水编号
  16.   
  17.   STR_POINT        = ["体力","精神","力量","魔力","韧性","灵活","???"]
  18.   #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,敏捷,幸运]
  19.   POINT_ADD_PARAM = [[12 ,  0,   0,  0,   0,   0,   0,   0],     #体力
  20.                      [0  , 12,   0,  0,   0,   0,   0,   0],     #精神
  21.                      [0  ,  0,   5,  0,   0,   0,   0,   0],     #力量
  22.                      [0  ,  0,   0,  0,   5,   0,   0,   0],     #魔力
  23.                      [0  ,  0,   0,  3,   0,   2,   0,   1],     #韧性
  24.                      [0  ,  0,   0,  0,   0,   0,   3,   0],     #灵活
  25.                      
  26.                      [0,0,0,0,0,0,0,0]]
  27.                      #可以按上面的格式添加下去,不过要改POINT_KIND,STR_ALL,不然加了也白加
  28.   
  29.   #分别对应增加       [物理命中,物理闪避,必杀,必杀闪避,魔法闪避,魔法反射,物理反击,HP再生,Mp再生,Tp再生]
  30.   POINT_ADD_XPARAM = [[0 , 0, 0, 0, 0, 0, 0, 6, 0, 0],
  31.                       [0 , 0, 0, 0, 0, 0, 0, 0, 6, 0],
  32.                       [6 , 6, 0, 0, 0, 0, 0, 0, 0, 0],
  33.                       [0 , 0, 6, 0, 0, 0, 0, 0, 0, 0],
  34.                       [0 , 0, 0, 0, 0, 0, 0, 4, 4, 0],
  35.                       [0 , 6, 0, 6, 6, 0, 0, 0, 0, 0],
  36.                      
  37.                       [0,0,0,0,0,0,0,0,0,0]]
  38.                      #这里的单位是万分之一数值也就是0.01%,我随便填了下【别嫌小,够大了,有心情你可以算算看平衡性】
  39.   
  40.   #各种名称
  41.   ADDPOINT       = "加点"   #菜单中选项
  42.   
  43.   POINT_NAME     = "属性点" #未分配点数
  44.   
  45.   XARAM_NAME     = ["物理命中","物理闪避","必杀","必杀闪避","魔法闪避","魔法反射","物理反击","HP再生","Mp再生","Tp再生"]
  46.   def reset(actor_id)
  47.     for i in 1..6
  48.       $game_variables[actor_id*(POINT_KIND+1) + POINT_VARIABLE]+=$game_variables[actor_id*(POINT_KIND+1) + POINT_VARIABLE+i]
  49.       $game_variables[actor_id*(POINT_KIND+1) + POINT_VARIABLE+i]=0
  50.     end
  51.   end
  52.   
  53.   def temp_all
  54.     r = 0
  55.     for i in 0 .. POINT_KIND-1
  56.       r+=$temp_point[i]
  57.     end
  58.     return r
  59.   end
  60.   
  61. end
  62. $temp_point = []
  63. for i in 0 .. Point_Tree::POINT_KIND-1
  64.   $temp_point.push(0)
  65. end

  66. class Game_Actor < Game_Battler
  67.   include Point_Tree
  68.   alias level_up_tre level_up
  69.   def level_up
  70.     level_up_tre
  71.     @hp += mhp
  72.     @mp += mmp
  73.     $game_variables[self.id*(POINT_KIND+1) + POINT_VARIABLE] += LEVEL_UP_POINT
  74.   end
  75.   def point_plus(param_id)
  76.     r=0
  77.     for i in 0 .. POINT_KIND-1
  78.       r+=$game_variables[self.id*(POINT_KIND+1) + POINT_VARIABLE+i+1]*POINT_ADD_PARAM[i][param_id]
  79.     end
  80.     return r
  81.   end

  82.   alias point_base_param param
  83.   
  84.   def param(param_id)
  85.     value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
  86.     value *= param_rate(param_id) * param_buff_rate(param_id)
  87.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  88.   end
  89.   def xparam(xparam_id)
  90.     xp = super(xparam_id)
  91.     for i in 0 .. POINT_KIND-1
  92.       xp+=($game_variables[self.id*(POINT_KIND+1) + POINT_VARIABLE+i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  93.     end
  94.     return xp
  95.   end
  96.   def use_item(item)
  97.     super
  98.     if item.id == RESET_ITEM
  99.       reset(self.id)
  100.       self.hp = [self.hp,self.mhp].min
  101.       self.mp = [self.mp,self.mmp].min
  102.     end
  103.   end
  104. end

  105. class Window_Point_Command < Window_Command
  106.   
  107.   include Point_Tree
  108.   #--------------------------------------------------------------------------
  109.   # ● 初始化指令选择位置(类方法)
  110.   #--------------------------------------------------------------------------
  111.   def self.init_command_position
  112.     @@last_command_symbol = nil
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 初始化对象
  116.   #--------------------------------------------------------------------------
  117.   def initialize(actor)
  118.     @status_window = nil
  119.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  120.     super(0,0)
  121.     select_last
  122.   end
  123.   def actor=(actor)
  124.     return if @actor == actor
  125.     @actor = actor
  126.     refresh
  127.   end
  128.   def status_window=(status_window)
  129.     return if @status_window == status_window
  130.     @status_window = status_window
  131.   self.windowskin = Cache.system("Window")
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 获取窗口的宽度
  135.   #--------------------------------------------------------------------------
  136.   def window_width
  137.     return 160
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 获取显示行数
  141.   #--------------------------------------------------------------------------
  142.   def visible_line_number
  143.     item_max
  144.   end
  145.   def get_actor_point(id)
  146.     s = $game_variables[@actor.id*(POINT_KIND+1)+POINT_VARIABLE+id+1].to_s
  147.     return "("+s+")+"+$temp_point[id].to_s
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ● 生成指令列表
  151.   #--------------------------------------------------------------------------
  152.   def make_command_list
  153.     for i in 0 .. POINT_KIND-1
  154.       add_command(STR_POINT[i]   + get_actor_point(i)  , :point_add  ,add_enabled)
  155.     end
  156.     add_command("确认",  :point_ok)
  157.     add_command("取消",  :point_cancle)
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 按下确定键时的处理
  161.   #--------------------------------------------------------------------------
  162.   def process_ok
  163.     @@last_command_symbol = current_symbol
  164.     super
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● 返回最后一个选项的位置
  168.   #--------------------------------------------------------------------------
  169.   def select_last
  170.     select_symbol(@@last_command_symbol)
  171.   end
  172.   
  173.   def add_enabled
  174.     temp_all < $game_variables[@actor.id*(POINT_KIND+1) + POINT_VARIABLE]
  175.   end

  176.   def update_help
  177.     @help_window.set_text(self.index+1) if @help_window
  178.     @status_window.index = self.index if @status_window
  179.   end
  180. end

  181. #帮助窗口
  182. class Window_Point_Help < Window_Base
  183.   include Point_Tree
  184.   def initialize(x,y,w,h)
  185.     super(x, y, w, h)
  186.    
  187.    
  188.   end
  189.   def set_text(id)
  190.     contents.clear
  191.     if id <= POINT_KIND
  192.       text = "\\}提升一点该属性"
  193.     elsif id == POINT_KIND+1
  194.       text = "\\}确认此次加点分配"
  195.     elsif  id == POINT_KIND+2
  196.       text = "\\}取消此次加点分配"
  197.     end
  198.     draw_text_ex(8, 8, text)
  199.   end
  200. end


  201. #角色状态窗口
  202. class Window_Point_Actor < Window_Base
  203.   include Point_Tree
  204.   
  205.   
  206.   def initialize(actor)
  207.     super(160, 0, Graphics.width - 160, Graphics.height)
  208.     @actor = actor
  209.     [url=home.php?mod=space&uid=370741]@Index[/url] = 0
  210.     refresh
  211.   end
  212.   def actor=(actor)
  213.     return if @actor == actor
  214.     @actor = actor
  215.     refresh
  216.   end
  217.   def index=(index)
  218.     return if @index == index
  219.     @index = index
  220.     refresh
  221.   end
  222.   def line_height
  223.     return 24
  224.   end
  225.   def refresh
  226.     contents.clear
  227.     contents.font.size = 24
  228.     draw_actor_name(@actor, 100, 0)
  229.     draw_actor_class(@actor, 240, 0)
  230.     draw_actor_face(@actor, 2, 0)
  231.     contents.font.size = 20
  232.     draw_actor_level(@actor, 102,  24)
  233.     draw_actor_point(100,48)
  234.     contents.font.size = 16
  235.     draw_actor_param_point(8,16 * 6)
  236.     draw_actor_xparam_point(8,16 * 14)
  237.   end
  238.   def draw_actor_point(x,y)
  239.     draw_text(x,y,200,line_height,"  未分配"+POINT_NAME + ":" + $game_variables[@actor.id*(POINT_KIND+1) + POINT_VARIABLE].to_s)
  240.     draw_text(x,y+line_height,200,line_height,"此次分配"+POINT_NAME + ":" + temp_all.to_s)
  241.   end
  242.   def draw_actor_param_point(x,y)
  243.     8.times {|i| draw_actor_param_to_s(x,y,i)}
  244.   end
  245.   def draw_actor_xparam_point(x,y)
  246.     10.times {|i| draw_actor_xparam_to_s(x,y,i)}
  247.   end
  248.   
  249.   def draw_actor_param_to_s(x,y,param_id)
  250.     a=0
  251.     for i in 0 .. POINT_KIND-1
  252.       a+=$temp_point[i]*POINT_ADD_PARAM[i][param_id]
  253.     end
  254.     s1 = Vocab::param(param_id)
  255.     s2 = @actor.param(param_id).to_s
  256.     s3 = (@actor.param(param_id) + a).to_s
  257.     if @index < POINT_KIND
  258.       if POINT_ADD_PARAM[@index][param_id]==0
  259.         s4 = ""
  260.       else
  261.         s4 = "+" + POINT_ADD_PARAM[@index][param_id].to_s
  262.       end
  263.     else
  264.       s4 = ""
  265.     end
  266.    
  267.     change_color(system_color)
  268.     draw_text(x,y+16*param_id,100,line_height,s1)
  269.     change_color(normal_color)
  270.     s2+= " →"
  271.     draw_text(x+82,y+16*param_id,120,line_height,s2,2)
  272.     change_color(system_color)
  273.     draw_text(x+150,y+16*param_id,100,line_height,s3,2)
  274.     change_color(normal_color)
  275.     contents.font.size = 14
  276.     draw_text(x+266,y+16*param_id,100,line_height,s4)
  277.     contents.font.size = 16
  278.   end
  279.   def draw_actor_xparam_to_s(x,y,xparam_id)
  280.     a=0.00
  281.     for i in 0 .. POINT_KIND-1
  282.       a+=($temp_point[i]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  283.     end
  284.     s1 = XARAM_NAME[xparam_id]
  285.     s2 = sprintf("%02.2f%%",@actor.xparam(xparam_id)*100)
  286.     s3 = sprintf("%02.2f%%",(@actor.xparam(xparam_id) + a)*100)
  287.     print @actor.xparam(xparam_id) + a if a!=0
  288.     print "\n" if a!=0
  289.     if @index < POINT_KIND
  290.       if POINT_ADD_XPARAM[@index][xparam_id]==0
  291.         s4=""
  292.       else
  293.         s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
  294.       end
  295.     else
  296.       s4 = ""
  297.     end
  298.    
  299.     change_color(system_color)
  300.     draw_text(x,y+16*xparam_id,100,line_height,s1)
  301.     change_color(normal_color)
  302.     s2+= " →"
  303.     draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
  304.     change_color(system_color)
  305.     draw_text(x+150,y+16*xparam_id,100,line_height,s3,2)
  306.     change_color(normal_color)
  307.     contents.font.size = 14
  308.     draw_text(x+266,y+16*xparam_id,100,line_height,s4)
  309.     contents.font.size = 16
  310.    
  311.    
  312.   end
  313. end

  314. class Scene_Point < Scene_Base
  315.   include Point_Tree
  316.   def start
  317.     super
  318.     create_background
  319.     @actor = $game_party.menu_actor
  320.     create_command_window
  321.     create_status_window
  322.     create_help_window
  323.     @command_window.activate
  324.   end
  325.   def terminate
  326.     super
  327.     dispose_background
  328.   end
  329.   def create_background
  330.     @background_sprite = Sprite.new
  331.     @background_sprite.bitmap = SceneManager.background_bitmap
  332.     @background_sprite.color.set(16, 16, 16, 128)
  333.   end
  334.   def dispose_background
  335.     @background_sprite.dispose
  336.   end
  337.   
  338.   def create_command_window
  339.     @command_window = Window_Point_Command.new(@actor)
  340.     @command_window.set_handler(:cancel,      method(:return_scene))
  341.     @command_window.set_handler(:pagedown,    method(:next_actor))
  342.     @command_window.set_handler(:pageup,      method(:prev_actor))
  343.     @command_window.set_handler(:point_add,   method(:add_point))
  344.     @command_window.set_handler(:point_ok,    method(:add_ok))
  345.     @command_window.set_handler(:point_cancle,method(:add_cancle))
  346.    
  347.   end
  348.   def return_scene
  349.     add_cancle
  350.     SceneManager.return
  351.   end
  352.   def create_status_window
  353.     @status_window = Window_Point_Actor.new(@actor)
  354.     @command_window.status_window = @status_window
  355.   end
  356.   def create_help_window
  357.     @help_window = Window_Point_Help.new(0,@command_window.height,160,[email]Graphics.height-@command_window.height[/email])
  358.     #(0, 216, 160, 200)
  359.     @help_window.viewport = @viewport
  360.     @command_window.help_window = @help_window
  361.   end
  362.   
  363.   def add_point
  364.     if temp_all >= $game_variables[@actor.id*(POINT_KIND+1) + POINT_VARIABLE]
  365.       @command_window.activate
  366.       return
  367.     end
  368.     $temp_point[@command_window.index] += 1
  369.     @status_window.refresh
  370.     @command_window.refresh
  371.     @command_window.activate
  372.   end
  373.   

  374.   def add_ok
  375.     for i in 0 .. POINT_KIND-1
  376.       $game_variables[@actor.id*(POINT_KIND+1) + POINT_VARIABLE+i+1] += $temp_point[i]
  377.     end
  378.     $game_variables[@actor.id*(POINT_KIND+1) + POINT_VARIABLE] -= temp_all
  379.     add_cancle
  380.   end
  381.   
  382.   def add_cancle
  383.     for i in 0 .. POINT_KIND-1
  384.       $temp_point[i]=0
  385.     end
  386.     @status_window.refresh
  387.     @command_window.refresh
  388.     @command_window.activate
  389.   end
  390.   
  391.   
  392.   def next_actor
  393.     @actor = $game_party.menu_actor_next
  394.     on_actor_change
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 切换到上一个角色
  398.   #--------------------------------------------------------------------------
  399.   def prev_actor
  400.     @actor = $game_party.menu_actor_prev
  401.     on_actor_change
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 切换角色
  405.   #--------------------------------------------------------------------------
  406.   def on_actor_change
  407.     @status_window.actor = @actor
  408.     @command_window.actor = @actor
  409.     @command_window.activate
  410.   end
  411.   
  412. end

  413. class Window_MenuCommand < Window_Command
  414.   alias add_original_commands_old add_original_commands
  415.   def add_original_commands
  416.     add_original_commands_old
  417.     add_command(Point_Tree::ADDPOINT,    :addpoint)
  418.   end
  419. end

  420. class Scene_Menu < Scene_MenuBase
  421.   alias create_command_window_old create_command_window
  422.   def create_command_window
  423.     create_command_window_old
  424.     @command_window.set_handler(:addpoint,method(:add_point))
  425.   end
  426.   def add_point
  427.     @status_window.select_last
  428.     @status_window.activate
  429.     @status_window.set_handler(:ok,     method(:on_ok))
  430.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  431.   end
  432.   def on_ok
  433.     SceneManager.call(Scene_Point)
  434.     Window_Point_Command::init_command_position
  435.   end
  436. end



  437. class Scene_ItemBase < Scene_MenuBase
  438.   def item_usable?
  439.     if item.id == Point_Tree::RESET_ITEM
  440.       return true
  441.     end
  442.     user.usable?(item) && item_effects_valid?
  443.   end
  444. end




  445. =begin
  446. ------------------------------
  447. class Window_Status < Window_Selectable
  448.   include Point_Tree
  449.   alias draw_parameters_old draw_parameters
  450.   def draw_parameters(x, y)
  451.     draw_parameters_old(x,y)
  452.     draw_point(x,y)
  453.   end
  454.   def draw_point(x,y)
  455.     for i in 0..5
  456.       change_color(system_color)
  457.       draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
  458.       change_color(normal_color)
  459.       draw_text(x+180, y+ line_height * i, 36, line_height,$game_variables[@actor.id*(POINT_KIND+1)+POINT_VARIABLE+i+1], 2)
  460.     end
  461.   end
  462.   
  463. end

  464. class Window_Base < Window
  465.   def draw_actor_param(actor, x, y, param_id)
  466.     change_color(system_color)
  467.     draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
  468.     change_color(normal_color)
  469.     draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  470.   end
  471. end
  472. ---------------------------------
  473. =end
复制代码

可是
QQ图片20140207213105.jpg
在箭头所指的地方字太小了,怎么加大,找了半天也没找到啊

点评

在189行def initialize(x,y,w,h) super(x, y, w, h) end的后面 def set_text(id)的前面插入  发表于 2014-2-7 21:53
OK了 已编辑  发表于 2014-2-7 21:47
啊 对 我忘了 又犯了一样的错误  发表于 2014-2-7 21:46

点击签名档去一个神奇的地方

百合控

梦石
0
星屑
6548
在线时间
1275 小时
注册时间
2013-8-21
回帖
3522

开拓者

发表于 2014-2-7 21:37:53 | 显示全部楼层
本帖最后由 余烬之中 于 2014-2-7 21:47 编辑

195行左右
找到
  1. def set_text(id)
  2.     contents.clear
  3.     if id <= POINT_KIND
复制代码
改成
  1. def set_text(id)
  2.     contents.clear
  3.     contents.font.size = 24
  4.     if id <= POINT_KIND
复制代码
那个24自己改没问题吧

↑这样改是不行的 而且也不需要
在刚刚的set_text方法后新增一个方法
  1.   alias :mo_241e43c6451d79ce81a94bc0b22c3ea5_rfont_settings :reset_font_settings
  2.   def reset_font_settings
  3.     mo_241e43c6451d79ce81a94bc0b22c3ea5_rfont_settings
  4.     contents.font.size = 24
  5.   end
复制代码

点评

这个加在哪里呢  发表于 2014-2-7 21:49
不知道我哪里弄错了,没用啊  发表于 2014-2-7 21:44

评分

参与人数 2星屑 +23 梦石 +1 收起 理由
迷糊的安安 + 1 认可答案,非常感谢您的帮助~
江户川洛奇 + 23 认可答案(谢谢你了,糖全给你.

查看全部评分

萌新瑟瑟发抖
看到我请叫我去干活
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部