注册会员 登录
Project1 返回首页

鼠窝 https://rpg.blue/?335626 [收藏] [复制] [分享] [RSS] ~外站脚本图书馆~

日志

菜单显示回合数

热度 2已有 686 次阅读2014-5-27 21:49 |个人分类:外站脚本

 
#######################
# Battle Count Window #
#######################
# Version 0.0.1 #
##########################
# aWhiteRaven / Newbcake #
################################################################################
# This is my first script. I learned from just looking at the smaller scripts.
# It's not perfect as it doesnt factor in anything such as existing windows.
# At least I do not think it does.
################################################################################
# Instructions (if needed):
# Put above (Main) and under (Materials)
################################################################################
# Credits: Adrien
# Basically his script was the easiest to understand
################################################################################
#--------------------------------------------------------------------------
# Start Customizable Section
#--------------------------------------------------------------------------
module WindowBattleCount
  # Set to use either an icon or not. Default is true. If false, it will print
  # the text specified by BC.
  USE_ICON = true
  # This is the string you want to appear IF you specify that want one.
  BC = "Battles"
  # What icon to use
  ICON = 1
end
#--------------------------------------------------------------------------
# End Customizable Section
#--------------------------------------------------------------------------
class BC_Window < Window_Base
  #--------------------------------------------------------------------------
  #   Initialize the window.
  #   super(x,y,width,height)
  #   This sets it at the left/right above any other windows.
  #   Width of 160, and a height of 1 row.
  #-------------------------------------------------------------------------
  def initialize
 super(0,0,160,fitting_height(1))
 refresh
  end
  #-------------------------------------------------------------------------
  #   Clears anything in the window "cache"
  #   Uses the inherited draw_currency_value method to draw the number, the
  #   unit (user specified as icon or text) at x, y, and a width.
  #
  #   draw_curreny_value(value, unit, x, y, width)
  #-------------------------------------------------------------------------
  def refresh
 contents.clear
 draw_currency_value(battles, iconText, 0, 0, contents.width - 2)
  end
  #-------------------------------------------------------------------------
  #   Defines value as the battle count.
  #-------------------------------------------------------------------------
  def battles
 $game_system.battle_count
  end
  #-------------------------------------------------------------------------
  #   Draws the unit/icon for battles.
  #-------------------------------------------------------------------------
  def iconText
 if WindowBattleCount::USE_ICON == true
   draw_icon(WindowBattleCount::ICON,0,0)
 else
  draw_text_ex(0,0,WindowBattleCount::BC)
 end
  end
end
#--------------------------------------------------------------------------
# Alias the original start method and then add in the battle count window
#--------------------------------------------------------------------------
class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  #   Alias: start method.
  #--------------------------------------------------------------------------
  alias start_original start
  def start
  start_original
  create_bc_window
  end
  #--------------------------------------------------------------------------
  #   Create the window.
  #--------------------------------------------------------------------------
  def create_bc_window
  @bc_window = BC_Window.new
  @bc_window.x = 0
  @bc_window.y = (Graphics.height - @bc_window.height) - 98
  end
end

鸡蛋

鲜花

刚表态过的朋友 (0 人)

发表评论 评论 (1 个评论)

回复 子弹君 2014-6-19 20:56
火烧兔子的马甲: 并非回合数,而是战斗回数,也就是说进行一场战斗就会+1
= =没写清楚

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

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

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

GMT+8, 2024-3-29 06:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部