查看: 70|回复: 0

[转载发布] 全新傻瓜式任务系统

[复制链接]
  • TA的每日心情
    开心
    7 天前
  • 签到天数: 37 天

    连续签到: 3 天

    [LV.5]常住居民I

    2028

    主题

    32

    回帖

    7260

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    0
    卡币
    5184
    OK点
    16
    积分
    7260
    发表于 同元一千年八月四日(秋) | 显示全部楼层 |阅读模式
    升级版
    先看截图










    代码


    RUBY 代码
    1. #==============================================================================
    2. # ■ Window_Command    显示任务帮助窗口的类。
    3. #------------------------------------------------------------------------------
    4. #   脚本作者:薄凉看客,转载或使用请保留此信息。
    5. #==============================================================================
    6. class Window_Command
    7.   def update_help
    8.     caseself.index
    9.     when0
    10.       help = ""
    11.     when1
    12.       help = ""
    13.     when2
    14.       help = ""
    15.     end
    16.     @help_window.set_text(help)
    17.   end
    18. end
    复制代码

    RUBY 代码
    1. #==============================================================================
    2. # ■ Window_Helprw    显示任务帮助窗口的类。
    3. #------------------------------------------------------------------------------
    4. #   脚本作者:薄凉看客,转载或使用请保留此信息。
    5. #==============================================================================
    6. class Window_Helprw < Window_Base
    7.   def initialize
    8.     super(320, 50, 300, 380)
    9.     self.opacity = 0
    10.     self.contents = Bitmap.new(width - 32, height - 32)
    11.   end
    12.   def set_text(text, item = "", align = 0)
    13.     if text != @textor align != @alignor item != @item
    14.       self.contents.clear
    15.       self.contents.font.color = system_color
    16.       self.contents.font.size = 13
    17.       self.contents.draw_text(68, -2, self.width - 40, 32, "任务描述")
    18.       self.contents.draw_text(68, -2 + 113, self.width - 40, 32, "任务目标")
    19.       self.contents.draw_text(68, -2 + 226, self.width - 40, 32, "任务奖励")
    20.       if item == ""and text == ""
    21.       self.contents.font.color = Color.new(255, 120, 120, 255)
    22.       xx = "未选中任务,或没有领取任"
    23.       self.contents.draw_text(15, 20, self.width - 40, 32, xx, align)
    24.       xx = "务没有相关描绘。"
    25.       self.contents.draw_text(15, 40, self.width - 40, 32, xx, align)
    26.       xx = "未选中任务,或没有领取任"      
    27.       self.contents.draw_text(15, 111 + 22, self.width - 40, 32, xx, align)
    28.       xx = "务没有相关描绘。"
    29.       self.contents.draw_text(15, 111 + 42, self.width - 40, 32, xx, align)
    30.       xx = "未选中任务,或没有领取任"
    31.       self.contents.draw_text(15, 224 + 20, self.width - 40, 32, xx, align)
    32.       xx = "务没有相关描绘。"
    33.       self.contents.draw_text(15, 224 + 40, self.width - 40, 32, xx, align)
    34.       end
    35.       self.contents.font.color = normal_color
    36.       self.contents.font.size = 15
    37.       if item != ""
    38.       case item.name
    39.       when"一夫当关"
    40.       xx = "乱童山麓一行与树精"
    41.       self.contents.draw_text(27, 20, self.width - 40, 32, xx, align)
    42.       xx = "一战险些丢了命!虽"
    43.       self.contents.draw_text(27, 40, self.width - 40, 32, xx, align)
    44.       xx = "胜却也是惨胜,努力"
    45.       self.contents.draw_text(27, 60, self.width - 40, 32, xx, align)
    46.       xx = "修炼,方能未雨绸缪。"
    47.       self.contents.draw_text(27, 80, self.width - 40, 32, xx, align)
    48.       xx = "帕吉尔等级达到30级"
    49.       self.contents.draw_text(27, 111 + 22, self.width - 40, 32, xx, align)
    50.       self.contents.font.color = Color.new(120, 255, 120, 255)
    51.       xx = "完成情况:"
    52.       self.contents.draw_text(27, 111 + 42, self.width - 40, 32, xx, align)
    53.       if$game_party.actors[1].level < 30
    54.       self.contents.font.color = Color.new(255, 120, 120, 255)
    55.       xx = "(未达成)"
    56.       else
    57.       self.contents.font.color = Color.new(120, 255, 120, 255)
    58.       xx = "(已达成)"
    59.       end
    60.       self.contents.draw_text(100, 111 + 42, self.width - 40, 32, xx, align)      
    61.       self.contents.font.color = normal_color
    62.       xx = "当前等级:"
    63.       self.contents.draw_text(27, 111 + 62, self.width - 40, 32, xx, align)
    64.       self.contents.font.color = Color.new(120, 255, 120, 255)
    65.       actor = $game_party.actors[1]
    66.       xx = actor.level.to_s
    67.       self.contents.draw_text(100, 111 + 62, self.width - 40, 32, xx, align)
    68.       self.contents.font.color = normal_color
    69.       xx = "目标等级:"
    70.       self.contents.draw_text(27, 111 + 82, self.width - 40, 32, xx, align)  
    71.       self.contents.font.color = Color.new(255, 120, 120, 255)
    72.       xx = "30"
    73.       self.contents.draw_text(100, 111 + 82, self.width - 40, 32, xx, align)
    74.       self.contents.font.color = Color.new(120, 255, 120, 255)
    75.       bitmap = RPG::Cache.icon("刀.png")
    76.       self.contents.blt(15, 224 + 25, bitmap, Rect.new(0, 0, 24, 24))      
    77.       xx = "云霄·寒光刀 × 1"
    78.       self.contents.draw_text(45, 224 + 20, self.width - 40, 32, xx, align)
    79.       bitmap = RPG::Cache.icon("剑.png")
    80.       self.contents.blt(15, 224 + 45, bitmap, Rect.new(0, 0, 24, 24))
    81.       self.contents.font.color = Color.new(255, 120, 120, 255)
    82.       xx = "云霄·饮血剑 × 1"
    83.       self.contents.draw_text(45, 224 + 40, self.width - 40, 32, xx, align)
    84.       self.contents.font.color = Color.new(120, 120, 255, 255)
    85.       bitmap = RPG::Cache.icon("棍.png")
    86.       self.contents.blt(15, 224 + 65, bitmap, Rect.new(0, 0, 24, 24))      
    87.       xx = "云霄·月魔棍 × 1"
    88.       self.contents.draw_text(45, 224 + 60, self.width - 40, 32, xx, align)  
    89.       self.contents.font.color = Color.new(255, 255, 64, 255)
    90.       bitmap = RPG::Cache.icon("枪.png")
    91.       self.contents.blt(15, 224 + 85, bitmap, Rect.new(0, 0, 24, 24))      
    92.       xx = "云霄·青鳞枪 × 1"
    93.       self.contents.draw_text(45, 224 + 80, self.width - 40, 32, xx, align)
    94.       self.contents.font.color = Color.new(255, 120, 120, 255)
    95.       self.contents.font.size = 10
    96.       xx = "以上4种装备任选其一(要什么?要我?)"
    97.       self.contents.draw_text(10, 224 + 95, self.width - 40, 32, xx, align)
    98.       when"将魂"
    99.       xx = "将军战死沙场,他的传"
    100.       self.contents.draw_text(22, 20, self.width - 40, 32, xx, align)
    101.       xx = "说被埋葬,沉睡了千年"
    102.       self.contents.draw_text(22, 40, self.width - 40, 32, xx, align)      
    103.       xx = "的将军魂被魔军唤醒。"
    104.       self.contents.draw_text(22, 60, self.width - 40, 32, xx, align)
    105.       xx = "勇士,快去阻止他吧!"
    106.       self.contents.draw_text(22, 80, self.width - 40, 32, xx, align)   
    107.       xx = "进入将军墓中,阻止魔"
    108.       self.contents.draw_text(22, 111 + 22, self.width - 40, 32, xx, align)
    109.       xx = "军的邪恶计划!"
    110.       self.contents.draw_text(22, 111 + 42, self.width - 40, 32, xx, align)  
    111.       self.contents.font.color = Color.new(120, 255, 120, 255)
    112.       xx = "完成情况:"
    113.       self.contents.draw_text(22, 111 + 62, self.width - 40, 32, xx, align)  
    114.       self.contents.font.color = Color.new(255, 120, 120, 255)
    115.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    116.       xx = "(未完成)"
    117.       self.contents.draw_text(100, 111 + 62, self.width - 40, 32, xx, align)
    118.       self.contents.font.color = Color.new(255, 255, 64, 255)
    119.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    120.       xx = "未打败,魔·将魂"
    121.       self.contents.draw_text(22, 111 + 82, self.width - 40, 32, xx, align)
    122.       bitmap = RPG::Cache.icon("书·桔色皮.png")
    123.       self.contents.blt(10, 224 + 25, bitmap, Rect.new(0, 0, 24, 24))      
    124.       xx = "战法·围魏救赵 × 1"
    125.       self.contents.font.color = Color.new(255, 255, 64, 255)
    126.       self.contents.draw_text(35, 224 + 20, self.width - 40, 32, xx, align)  
    127.       bitmap = RPG::Cache.icon("书·蓝皮.png")
    128.       self.contents.blt(10, 224 + 45, bitmap, Rect.new(0, 0, 24, 24))      
    129.       xx = "战法·火烧乌巢 × 1"
    130.       self.contents.font.color = Color.new(120, 120, 255, 255)
    131.       self.contents.draw_text(35, 224 + 40, self.width - 40, 32, xx, align)
    132.       bitmap = RPG::Cache.icon("书·绿皮.png")
    133.       self.contents.blt(10, 224 + 65, bitmap, Rect.new(0, 0, 24, 24))      
    134.       xx = "战法·窃符救赵 × 1"
    135.       self.contents.font.color = Color.new(120, 255, 120, 255)
    136.       self.contents.draw_text(35, 224 + 60, self.width - 40, 32, xx, align)  
    137.       bitmap = RPG::Cache.icon("书·紫皮.png")
    138.       self.contents.blt(10, 224 + 85, bitmap, Rect.new(0, 0, 24, 24))      
    139.       xx = "战法·草船借箭 × 1"
    140.       self.contents.font.color = Color.new(255, 120, 120, 255)
    141.       self.contents.draw_text(35, 224 + 80, self.width - 40, 32, xx, align)
    142.       self.contents.font.size = 10
    143.       xx = "以上4种战法任选其一(要什么?要我?)"
    144.       self.contents.draw_text(10, 224 + 95, self.width - 40, 32, xx, align)   
    145.       when"探索神秘之塔"
    146.       xx = "小镇后山有一神秘塔。"
    147.       self.contents.draw_text(22, 20, self.width - 40, 32, xx, align)
    148.       xx = "就连当地人也从未进去"
    149.       self.contents.draw_text(22, 40, self.width - 40, 32, xx, align)      
    150.       xx = "过,最近在塔顶出现了"
    151.       self.contents.draw_text(22, 60, self.width - 40, 32, xx, align)
    152.       xx = "奇异的色彩,去看看吧!"
    153.       self.contents.draw_text(22, 80, self.width - 40, 32, xx, align)   
    154.       xx = "登上神秘塔塔顶,打败"
    155.       self.contents.draw_text(22, 111 + 22, self.width - 40, 32, xx, align)
    156.       xx = "精灵,拿到月华天石。"
    157.       self.contents.draw_text(22, 111 + 42, self.width - 40, 32, xx, align)  
    158.       self.contents.font.color = Color.new(120, 255, 120, 255)
    159.       xx = "完成情况:"
    160.       self.contents.draw_text(22, 111 + 62, self.width - 40, 32, xx, align)  
    161.       self.contents.font.color = Color.new(255, 120, 120, 255)
    162.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    163.       xx = "(未完成)"
    164.       self.contents.draw_text(100, 111 + 62, self.width - 40, 32, xx, align)
    165.       self.contents.font.color = Color.new(255, 255, 64, 255)
    166.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    167.       xx = "未拿到月华天石"
    168.       self.contents.draw_text(22, 111 + 82, self.width - 40, 32, xx, align)
    169.       bitmap = RPG::Cache.icon("特殊魔石.png")
    170.       self.contents.blt(10, 224 + 25, bitmap, Rect.new(0, 0, 24, 24))      
    171.       xx = "魔石·莱西斯特 × 1"
    172.       self.contents.font.color = Color.new(255, 255, 64, 255)
    173.       self.contents.draw_text(35, 224 + 20, self.width - 40, 32, xx, align)  
    174.       bitmap = RPG::Cache.icon("自动魔石.png")
    175.       self.contents.blt(10, 224 + 45, bitmap, Rect.new(0, 0, 24, 24))      
    176.       xx = "魔石·拉捷特斯 × 1"
    177.       self.contents.font.color = Color.new(120, 120, 255, 255)
    178.       self.contents.draw_text(35, 224 + 40, self.width - 40, 32, xx, align)
    179.       bitmap = RPG::Cache.icon("技能魔石.png")
    180.       self.contents.blt(10, 224 + 65, bitmap, Rect.new(0, 0, 24, 24))      
    181.       xx = "魔石·新月之力 × 1"
    182.       self.contents.font.color = Color.new(120, 255, 120, 255)
    183.       self.contents.draw_text(35, 224 + 60, self.width - 40, 32, xx, align)  
    184.       bitmap = RPG::Cache.icon("魔法魔石.png")
    185.       self.contents.blt(10, 224 + 85, bitmap, Rect.new(0, 0, 24, 24))      
    186.       xx = "魔石·菲布尔利 × 1"
    187.       self.contents.font.color = Color.new(255, 120, 120, 255)
    188.       self.contents.draw_text(35, 224 + 80, self.width - 40, 32, xx, align)
    189.       self.contents.font.size = 10
    190.       xx = "随机以上4种魔石,看你有没有RP拿了!"
    191.       self.contents.draw_text(10, 224 + 95, self.width - 40, 32, xx, align)   
    192.       when"索尔的委托"
    193.       xx = "乱童山麓,索尔的妹妹"
    194.       self.contents.draw_text(22, 20, self.width - 40, 32, xx, align)
    195.       xx = "被魔蝎攻击,身中剧毒"
    196.       self.contents.draw_text(22, 40, self.width - 40, 32, xx, align)      
    197.       xx = "索尔自己要照看妹妹,"
    198.       self.contents.draw_text(22, 60, self.width - 40, 32, xx, align)
    199.       xx = "只好拜托你找解药了。"
    200.       self.contents.draw_text(22, 80, self.width - 40, 32, xx, align)   
    201.       xx = "找到解药:"
    202.       self.contents.draw_text(22, 111 + 22, self.width - 40, 32, xx, align)
    203.       xx = "九花玉露"
    204.       self.contents.draw_text(22, 111 + 42, self.width - 40, 32, xx, align)  
    205.       self.contents.font.color = Color.new(120, 255, 120, 255)
    206.       xx = "完成情况:"
    207.       self.contents.draw_text(22, 111 + 62, self.width - 40, 32, xx, align)  
    208.       self.contents.font.color = Color.new(255, 120, 120, 255)
    209.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    210.       xx = "(未完成)"
    211.       self.contents.draw_text(100, 111 + 62, self.width - 40, 32, xx, align)
    212.       self.contents.font.color = Color.new(255, 255, 64, 255)
    213.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    214.       xx = "未拿到九花玉露"
    215.       self.contents.draw_text(22, 111 + 82, self.width - 40, 32, xx, align)
    216.       bitmap = RPG::Cache.icon("048-Skill05.png")
    217.       self.contents.blt(10, 224 + 25, bitmap, Rect.new(0, 0, 24, 24))      
    218.       xx = "EXP 上升 10000 点"
    219.       self.contents.font.color = Color.new(255, 255, 64, 255)
    220.       self.contents.draw_text(35, 224 + 20, self.width - 40, 32, xx, align)  
    221.       bitmap = RPG::Cache.icon("048-Skill05.png")
    222.       self.contents.blt(10, 224 + 45, bitmap, Rect.new(0, 0, 24, 24))      
    223.       xx = "金钱 增加 10000"
    224.       self.contents.font.color = Color.new(120, 120, 255, 255)
    225.       self.contents.draw_text(35, 224 + 40, self.width - 40, 32, xx, align)
    226.       when"习乐"
    227.       xx = "音乐是最美妙的艺术!"
    228.       self.contents.draw_text(22, 20, self.width - 40, 32, xx, align)
    229.       xx = "人们在它的世界里陶醉!"
    230.       self.contents.draw_text(22, 40, self.width - 40, 32, xx, align)      
    231.       xx = "你与乐神仅一步之遥!"
    232.       self.contents.draw_text(22, 60, self.width - 40, 32, xx, align)
    233.       xx = "去追寻那天籁之音吧!"
    234.       self.contents.draw_text(22, 80, self.width - 40, 32, xx, align)   
    235.       xx = "向修道院中乐神习乐,"
    236.       self.contents.draw_text(22, 111 + 22, self.width - 40, 32, xx, align)
    237.       xx = "或者在菜单中学习乐。"
    238.       self.contents.draw_text(22, 111 + 42, self.width - 40, 32, xx, align)  
    239.       self.contents.font.color = Color.new(120, 255, 120, 255)
    240.       xx = "完成情况:"
    241.       self.contents.draw_text(22, 111 + 62, self.width - 40, 32, xx, align)  
    242.       self.contents.font.color = Color.new(255, 120, 120, 255)
    243.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    244.       xx = "(未完成)"
    245.       self.contents.draw_text(100, 111 + 62, self.width - 40, 32, xx, align)
    246.       self.contents.font.color = Color.new(255, 255, 64, 255)
    247.       #这里直接是未完成,其实写的时候,可以分歧一个开关
    248.       xx = "未学习乐"
    249.       self.contents.draw_text(22, 111 + 82, self.width - 40, 32, xx, align)
    250.       bitmap = RPG::Cache.icon("乐魂·Easy.png")
    251.       self.contents.blt(10, 224 + 25, bitmap, Rect.new(0, 0, 24, 24))      
    252.       xx = "乐魂·海之风暴 × 1"
    253.       self.contents.font.color = Color.new(255, 255, 64, 255)
    254.       self.contents.draw_text(35, 224 + 20, self.width - 40, 32, xx, align)  
    255.       bitmap = RPG::Cache.icon("乐魂·Fever.png")
    256.       self.contents.blt(10, 224 + 45, bitmap, Rect.new(0, 0, 24, 24))      
    257.       xx = "乐魂·高斯模糊 × 1"
    258.       self.contents.font.color = Color.new(120, 120, 255, 255)
    259.       self.contents.draw_text(35, 224 + 40, self.width - 40, 32, xx, align)
    260.       bitmap = RPG::Cache.icon("乐魂·Hard.png")
    261.       self.contents.blt(10, 224 + 65, bitmap, Rect.new(0, 0, 24, 24))      
    262.       xx = "乐魂·梦的预见 × 1"
    263.       self.contents.font.color = Color.new(120, 255, 120, 255)
    264.       self.contents.draw_text(35, 224 + 60, self.width - 40, 32, xx, align)  
    265.       bitmap = RPG::Cache.icon("乐魂·Normal.png")
    266.       self.contents.blt(10, 224 + 85, bitmap, Rect.new(0, 0, 24, 24))      
    267.       xx = "乐魂·天空之城 × 1"
    268.       self.contents.font.color = Color.new(255, 120, 120, 255)
    269.       self.contents.draw_text(35, 224 + 80, self.width - 40, 32, xx, align)
    270.       self.contents.font.size = 10
    271.       xx = "乐等级达到5,即可得以上4种乐魂之一。"
    272.       self.contents.draw_text(10, 224 + 95, self.width - 40, 32, xx, align)      
    273.       end  
    274.       end
    275.       @text = text
    276.       @item = item
    277.       @align = align
    278.       [url=home.php?mod=space&uid=95897]@actor[/url] = nil
    279.     end
    280.     self.visible = true
    281.   end
    282. end
    复制代码

    RUBY 代码
    1. #==============================================================================
    2. # ■ Window_Itemrw    显示任务列表窗口的类。
    3. #------------------------------------------------------------------------------
    4. #   脚本作者:薄凉看客,转载或使用请保留此信息。
    5. #==============================================================================
    6. class Window_Item < Window_Selectable
    7.   def refresh
    8.     ifself.contents != nil
    9.       self.contents.dispose
    10.       self.contents = nil
    11.     end
    12.     @data = []
    13.     for i in1...$data_items.size
    14.       if$game_party.item_number(i) > 0
    15.         if$data_items[i].description != "主线任务"and
    16.           $data_items[i].description != "支线任务"and
    17.           $data_items[i].description != "日常任务"
    18.         @data.push($data_items[i])
    19.         end
    20.       end
    21.     end
    22.     unless$game_temp.in_battle
    23.       for i in1...$data_weapons.size
    24.         if$game_party.weapon_number(i) > 0
    25.           @data.push($data_weapons[i])
    26.         end
    27.       end
    28.       for i in1...$data_armors.size
    29.         if$game_party.armor_number(i) > 0
    30.           @data.push($data_armors[i])
    31.         end
    32.       end
    33.     end
    34.     @item_max = @data.size
    35.     if@item_max > 0
    36.       self.contents = Bitmap.new(width - 32, row_max * 32)
    37.       for i in0...@item_max
    38.         draw_item(i)
    39.       end
    40.     end
    41.   end
    42. end  
    43. class Window_Itemrw < Window_Selectable
    44.   def initialize
    45.     super(107, 91, 210, 500)
    46.     @column_max = 1
    47.     refresh
    48.     self.index = -1
    49.   end
    50.   def item
    51.     return@data[self.index]
    52.   end
    53.   def refresh(kind = 0)
    54.     ifself.contents != nil
    55.       self.contents.dispose
    56.       self.contents = nil
    57.     end
    58.     @data = []
    59.     if kind == 0
    60.     for i in1...$data_items.size
    61.       if$game_party.item_number(i) > 0
    62.         if$data_items[i].description == "主线任务"
    63.         @data.push($data_items[i])
    64.         end
    65.       end
    66.     end
    67.     elsif kind == 1
    68.     for i in1...$data_items.size
    69.       if$game_party.item_number(i) > 0
    70.         if$data_items[i].description == "支线任务"
    71.         @data.push($data_items[i])
    72.         end
    73.       end
    74.     end
    75.     elsif kind == 2
    76.     for i in1...$data_items.size
    77.       if$game_party.item_number(i) > 0
    78.         if$data_items[i].description == "日常任务"
    79.         @data.push($data_items[i])
    80.         end
    81.       end
    82.     end
    83.     end
    84.     @item_max = @data.size
    85.     if@item_max > 0
    86.       self.contents = Bitmap.new(width - 32, row_max * 38)
    87.       for i in0...@item_max
    88.         draw_item(i)
    89.       end
    90.     end
    91.   end
    92.   def draw_item(index)
    93.     item = @data[index]
    94.     case item
    95.     whenRPG::Item
    96.       number = $game_party.item_number(item.id)
    97.     end
    98.     x = index % 1 * (150 + 32) + 10
    99.     y = index / 1 * 38
    100.     self.contents.font.size = 15
    101.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    102.   end
    103.   def update_help
    104.     @help_window.set_text(self.item == nil ? "" : self.item.description,
    105.     self.item == nil ? "" : @data[index])
    106.   end
    107.   def update_cursor_rect
    108.   self.cursor_rect.empty
    109.   end  
    110. end
    复制代码

    RUBY 代码
    1. #==============================================================================
    2. # ■ Blkk_rw    显示任务场景的类。
    3. #------------------------------------------------------------------------------
    4. #   脚本作者:薄凉看客,转载或使用请保留此信息。
    5. #==============================================================================
    6. class Blkk_rw
    7.   def initialize(index = 0)
    8.     @index = index
    9.   end
    10.   def main
    11.     xx = Spriteset_Map.new
    12.     blkk = []
    13.     blkk[15] = 0
    14.     @command_window = Window_Command.new(210, [
    15.     "", "", ""], blkk)
    16.     @command_window.index = @index
    17.     @command_window.visible = false
    18.     @help_window = Window_Helprw.new
    19.     @item_window = Window_Itemrw.new
    20.     @item_window.active = false
    21.     @item_window.opacity = 0
    22.     @command_window.help_window = @help_window
    23.     @item_window.help_window = @help_window
    24.     picture = Sprite.new
    25.     picture.bitmap = Bitmap.new("Graphics/Pictures/任务背景图.png")
    26.     picture.x -= 18
    27.     @picture2 = Sprite.new
    28.     @picture2.bitmap = Bitmap.new("Graphics/Pictures/主线任务.png")
    29.     @picture2.x -= 18
    30.     @picture3 = Sprite.new
    31.     @picture3.bitmap = Bitmap.new("Graphics/Pictures/支线任务.png")
    32.     @picture3.x -= 18
    33.     @picture3.opacity = 0
    34.     @picture4 = Sprite.new
    35.     @picture4.bitmap = Bitmap.new("Graphics/Pictures/日常任务.png")
    36.     @picture4.x -= 18
    37.     @picture4.opacity = 0
    38.     [url=home.php?mod=space&uid=124475]@arrow[/url] = Sprite.new
    39.     @arrow.bitmap = Bitmap.new("Graphics/Pictures/arrow4.png")
    40.     @arrow.x = 100
    41.     @arrow.y = 106
    42.     @arrow.opacity = 0
    43.     Graphics.transition
    44.     loopdo
    45.       Graphics.update
    46.       Input.update
    47.       update
    48.       if$scene != self
    49.         break
    50.       end
    51.     end
    52.     Graphics.freeze
    53.     @command_window.dispose
    54.     xx.dispose
    55.     picture.dispose
    56.     @picture2.dispose
    57.     @picture3.dispose
    58.     @picture4.dispose
    59.     @arrow.dispose
    60.     @help_window.dispose
    61.     @item_window.dispose
    62.   end
    63.   def update
    64.     @command_window.update
    65.     @help_window.update
    66.     @item_window.update
    67.     @item_window.refresh(@command_window.index)
    68.     case@command_window.index
    69.     when0
    70.       @picture2.opacity = 255
    71.       @picture3.opacity = 0
    72.       @picture4.opacity = 0
    73.     when1
    74.       @picture2.opacity = 0
    75.       @picture3.opacity = 255
    76.       @picture4.opacity = 0
    77.     when2
    78.       @picture2.opacity = 0
    79.       @picture3.opacity = 0
    80.       @picture4.opacity = 255
    81.     end
    82.     case@item_window.index
    83.     when-1
    84.       @arrow.opacity = 0
    85.     when0
    86.       @arrow.y = 106
    87.       @arrow.opacity = 255
    88.     when1
    89.       @arrow.y = 106 + 38
    90.       @arrow.opacity = 255
    91.     when2
    92.       @arrow.y = 106 + 38 * 2
    93.       @arrow.opacity = 255
    94.     when3
    95.       @arrow.y = 106 + 38 * 3
    96.       @arrow.opacity = 255
    97.     when4
    98.       @arrow.y = 106 + 38 * 4
    99.       @arrow.opacity = 255
    100.     when5
    101.       @arrow.y = 106 + 38 * 5
    102.       @arrow.opacity = 255
    103.     when6
    104.       @arrow.y = 106 + 38 * 6
    105.       @arrow.opacity = 255      
    106.     end  
    107.     if@command_window.active
    108.       update_command
    109.       return
    110.     end
    111.     if@item_window.active
    112.       update_item
    113.       return
    114.     end   
    115.   end
    116.   def update_command
    117.     if Input.trigger?(Input::B)
    118.       $game_system.se_play($data_system.cancel_se)
    119.       $scene = Scene_Map.new
    120.       return
    121.     end
    122.     if Input.trigger?(Input::C)
    123.       $game_system.se_play($data_system.decision_se)
    124.       case@command_window.index
    125.       when0
    126.         @command_window.active = false
    127.         @item_window.active = true
    128.         @item_window.index = 0
    129.      when1
    130.         @command_window.active = false
    131.         @item_window.active = true
    132.         @item_window.index = 0
    133.       when2
    134.         @command_window.active = false
    135.         @item_window.active = true
    136.         @item_window.index = 0
    137.       end
    138.       return
    139.     end  
    140.   end
    141.   def update_item
    142.     if Input.trigger?(Input::B)
    143.       $game_system.se_play($data_system.cancel_se)
    144.       @item_window.active = false
    145.       @command_window.active = true
    146.       @item_window.index = -1
    147.       return
    148.     end
    149.   end
    150. end
    复制代码



    赠送:超级命令窗体脚本


    RUBY 代码
    [code]#==============================================================================
    # ■ Window_Command    超级命令窗体的类。
    #------------------------------------------------------------------------------
    #   脚本作者:薄凉看客,转载或使用请保留此信息。
    #==============================================================================
    =begin

    在生成Command.new时后边可以有第三个参数——一个数组(另附加一个图标文件名数组)

    数组详细说明(数组参数是非必须的,可有可无):
    [0:列数, 1:X坐标, 2:Y坐标, 3:Z坐标, 4:未选中字体大小, 5:选中字体大小,
    6:未选中字体时的颜色, 7:选中字体时的颜色, 8:未选中时的字体名, 9:选中时的字体名,
    10:项目无效化时的字体名, 11:项目无效化1, 12:项目无效化2, 13:项目无效化3,
    14:项目无效化4, 15:窗口的不透明度, 16:背景的不透明度, 17:内容的不透明度,
    18:是否显示图标]
    注:如果需要显示图标,需要再加一个数组参数(非必须)来指定图标文件名(
    当然也可以使用默认图标,数组内指定的图标会按012345的顺序依次显示,而
    且不管你有几个选项,你都必须指定6个图标名,否则按默认处理)。

    举个例子:

    #---------把Scene_Menu的26行脚本替换为以下内容,就能看到效果---------

    array_menu = []
    array_menu[0] = 6#让选择项横着选
    array_menu[1] = 0#修改命令窗体的X坐标
    array_menu[2] = 100#修改命令窗体的Y坐标为100
    array_menu[4] = 15#修改命令窗体未选中时的字体大小为15
    array_menu[5] = 22#修改命令窗体选中时的字体大小为22
    array_menu[3] = 500#修改Z坐标,保证命令窗体显示在最上方
    array_menu[11] = 5#让5号选择项(即结束)无效化
    array_menu[15] = 150#修改窗体的不透明度
    array_menu[16] = 150#修改背景的不透明度
    array_menu[17] = 150#修改内容的不透明度
    array_menu[18] = true#给命令窗体显示上图标
    icon_commands = ["041-Item10.png", "050-Skill07.png",
    "019-Accessory04.png", "045-Skill02.png", "036-Item05.png",
    "046-Skill03.png"]#这是指定图标文件名
    mmand_window = Window_Command.new(640, [s1, s2, s3, s4, s5, s6],
    array_menu, icon_commands)

    #---------把Scene_Menu的26行脚本替换为以上内容,就能看到效果---------

    =end
    class Window_Command < Window_Selectable
      def initialize(width, command, commands = [], icon_commands = 0)
        if icon_commands = 0or icon_commands.class != Array
          icon_commands = ["041-Item10.png", "050-Skill07.png",
          "019-Accessory04.png", "045-Skill02.png", "036-Item05.png",
          "046-Skill03.png"]
        elsif icon_commands.class == Arrayand(icon_commands[0] == nilor
          icon_commands[1] == nilor icon_commands[2] == nilor
          icon_commands[3] == nilor icon_commands[4] == nilor
          icon_commands[5] == nil)
          icon_commands = ["041-Item10.png", "050-Skill07.png",
          "019-Accessory04.png", "045-Skill02.png", "036-Item05.png",
          "046-Skill03.png"]
        end  
        if commands.class != Array
          commands = []
        end  
        if commands[0] == 1or commands[0] == nil
          if commands[1] == niland commands[2] != nil
          super(0, commands[2], width, command.size * 32 + 32)
          elsif commands[1] != niland commands[2] == nil
          super(commands[1], 0, width, command.size * 32 + 32)
          elsif commands[1] == niland commands[2] == nil
          super(0, 0, width, command.size * 32 + 32)
          elsif commands[1] != niland commands[2] != nil
          super(commands[1], commands[2], width, command.size * 32 + 32)      
          end
        else
          if commands[1] == niland commands[2] != nil
          super(0, commands[2], width, 64)
          elsif commands[1] != niland commands[2] == nil
          super(commands[1], 0, width, 64)
          elsif commands[1] == niland commands[2] == nil
          super(0, 0, width, 64)
          elsif commands[1] != niland commands[2] != nil
          super(commands[1], commands[2], width, 64)
          end
        end
        if commands[3] != nil
        self.z = commands[3]
        else
        self.z = 100
        end
        @command = command
        @item_max = @command.size
        if commands[0] != nil
        @column_max = commands[0]
        else
        @column_max = 1
        end
        if commands[4] != nil
        @size1 = commands[4]
        else
        @size1 = 22
        end
        if commands[5] != nil
        @size2 = commands[5]
        else
        @size2 = 22
        end
        if commands[6] != nil
        @color1 = commands[6]
        else
        @color1 = normal_color
        end
        if commands[7] != nil
        @color2 = commands[7]
        else
        @color2 = normal_color
        end
        if commands[8] != nil
        @name1 = commands[8]
        else
        @name1 = "黑体"
        end
        if commands[9] != nil
        @name2 = commands[9]
        else
        @name2 = "黑体"
        end
        if commands[10] != nil
        @name3 = commands[10]
        else
        @name3 = "黑体"
        end
        if commands[11] != nil
        @disable_item1 = commands[11]
        else
        @disable_item1 = -1
        end
        if commands[12] != nil
        @disable_item2 = commands[12]
        else
        @disable_item2 = -1
        end
        if commands[13] != nil
        @disable_item3 = commands[13]
        else
        @disable_item3 = -1
        end
        if commands[14] != nil
        @disable_item4 = commands[14]
        else
        @disable_item4 = -1
        end
        self.contents = Bitmap.new(width - 32, @item_max * 32)
        if commands[15] != niland commands[15] >= 0and commands[15] = 0and commands[16] = 0and commands[17]

    本帖子中包含更多资源

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

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

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

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

    GMT+8, 2024-5-17 18:53 , Processed in 0.050972 second(s), 44 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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