扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 163|回复: 0

[转载发布] 全局时间变量(仿牧场物语?)更新为2.0 增加昼夜系统

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    5 小时前
  • 签到天数: 114 天

    连续签到: 4 天

    [LV.6]常住居民II

    2338

    主题

    403

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10607
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13376

    灌水之王

    发表于 2024-4-19 16:23:28 | 显示全部楼层 |阅读模式
    效果:年,月,天,时,分,秒全部可以挂上变量 直接可以在如11点11分11秒开启某事件


    默认是50号开关 开启/关闭 时间窗口



    效果图


    2009.05.19更新日志:
      1,直接可以在脚本定义所有内容。初始时间只需在地图定义个变量数值即可,因为算法已经代入到脚本里。修改运算幅度是脚本39行
      2,优化下。初始时间为星期一.0点0分0秒.添加日期功能(如年,月)自行添加

    2009.07.03更新日志:
      1,添加昼夜版.往下拉


    直接MAIN前插入[code]#--------------------------------------------------------------------------  # 使用方法:打开50号(默认)开启时间功能,关闭50号则窗口关闭  #   # 如当周六晚8点 某商店才会开门(某事件在指定时间触发)  #  #定义时间算法在脚本39行  #                                       66RPG 沉默一秒钟(塑望)  #                                       Blog:hi.baidu.com/yuilife  #转载请保留以上信息  #--------------------------------------------------------------------------class Window_Time < Window_Base    $时间窗口开关 = 50 #时间的开关  #----------以上为开关----------#  #----------以下为变量----------#  $天 = 49 #天的变量  $时 = 48 #时的变量  $分 = 47 #分的变量  $秒 = 46 #秒的变量    #--------------------------------------------------------------------------  # ● 初始化对像   #--------------------------------------------------------------------------  def initialize    super(0, 0, 250, 55) #窗口坐标以及大小    self.contents = Bitmap.new(width - 32, height - 32)    self.opacity = 0    refresh  end  #--------------------------------------------------------------------------  # ● 刷新    #--------------------------------------------------------------------------  def refresh    if $game_switches[$时间窗口开关]    self.opacity = 255    self.contents.font.color = system_color    self.contents.font.size = 18         $game_variables[$秒] += 0.2#日期运算速度这里改.秒的运算   if $game_variables[$秒] >= 60     $game_variables[$秒] = 0     $game_variables[$分] += 1   end       if $game_variables[$分] >= 60     $game_variables[$分] = 0     $game_variables[$时] += 1   end       if $game_variables[$时] >= 24     $game_variables[$时] = 0     $game_variables[$天] += 1   end      if $game_variables[$天] >= 8     $game_variables[$天] = 1   end  self.contents.clear    if $game_variables[$时] >= 0 and $game_variables[$时] = 12 and $game_variables[$时] = 60     $game_variables[$秒] = 0     $game_variables[$分] += 1   end       if $game_variables[$分] >= 60     $game_variables[$分] = 0     $game_variables[$时] += 1   end       if $game_variables[$时] >= 24     $game_variables[$时] = 0     $game_variables[$天] += 1   end      if $game_variables[$天] >= 8     $game_variables[$天] = 1   end    self.contents.clear      if $game_variables[$时] >= 0 and $game_variables[$时] = 12 and $game_variables[$时]

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-14 23:19 , Processed in 0.085963 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表