扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 132|回复: 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 17:32:29 | 显示全部楼层 |阅读模式
    恩,本来打算参加短篇大赛的,不过将要完工最后一天,被小真狠狠批了一顿,所以,就放弃了= =留下了以下产物:
    (仿风色幻想)大地图脚本

    (仿风色幻想)选择项脚本

    (那个……背景只是敷衍一下……另外,使用这个可能需要一些折中的技巧)
    (仿风色幻想)对话脚本,只是在已有的基础上修改了一下,原脚本出自《走近科学》
    还有一个线索Scene,做得很烂,就不要看了吧{/gg}
    范例包(包括以上所有内容):
    http://rpg.blue/UP_PIC/200801/仿风色幻想.rar

    大地图脚本
    1. class PlaceIcon  attr_reader :x  attr_reader :y  WIDTH     = 24  HEIGHT    = 24  WIDTH_A   = 32  HEIGHT_A  = 32  def initialize(x,y,icon_name)    #x,y为中央坐标    @x = x    @y = y    @lx = x - WIDTH  / 2    @ly = y - HEIGHT / 2    @lx_a = x - WIDTH_A  / 2    @ly_a = y - HEIGHT_A / 2    @icon_name = icon_name    @icon_bitmap = RPG::Cache.icon(icon_name)  end  def mouse_in?    array = Mouse.pos    if @lx < array[0] and array[0] < @lx + WIDTH      if @ly < array[1]and array[1] < @ly + HEIGHT        return true      end    end    return false  end  def draw(sprite)    if mouse_in?      draw_l(sprite)    else      draw_s(sprite)    end  end  def draw_s(sprite)    sprite.bitmap.stretch_blt(Rect.new(@lx,@ly,WIDTH,HEIGHT),@icon_bitmap, @icon_bitmap.rect)   end  def draw_l(sprite)    sprite.bitmap.stretch_blt(Rect.new(@lx_a,@ly_a,WIDTH_A,HEIGHT_A),@icon_bitmap, @icon_bitmap.rect)   endendclass Window_Place   attr_accessor :visible  def initialize(start_in)    @visible = false    @sprite = Sprite.new    @sprite.bitmap = Bitmap.new(280,173)    @sprite.x = 640 - 280    @sprite.y = 480 - 173    @back_bitmap = RPG::Cache.windowskin("WorldHelp")    @in_bitmap = RPG::Cache.tileset(start_in)    @name_now = ""    @sprite.z = 6001  end  def change_in(str,name)    @in_bitmap = RPG::Cache.tileset(str)    @name_now = name  end    def update    @sprite.bitmap.clear    if @visible == false       return    end    @sprite.bitmap.blt(0,0,@back_bitmap,@back_bitmap.rect)    @sprite.bitmap.blt(15,15,@in_bitmap,@in_bitmap.rect)    @sprite.bitmap.font.color = Color.new(0,0,0,255)    @sprite.bitmap.font.size = 14    @sprite.bitmap.draw_text(15,15+128,256,15,@name_now,1)  end  def dispose    @sprite.dispose  endend#==============================================================================# ■ Scene_Map#------------------------------------------------------------------------------#  处理地图画面的类。#==============================================================================class Scene_Map_s  attr_accessor :spriteset  attr_accessor :message_window  def initialize(back)    @back_bitmap = RPG::Cache.picture(back)    @icons = []    @helps = []    @names = []    @numbs = []    @sprite = Sprite.new    @sprite.bitmap = Bitmap.new(640,480)    @sprite.z = 6000    #这里随便填一个存在的图片名(Tilesets)    ###########################################    @help_window = Window_Place.new("Awmp_006")    ###########################################    ###########################################  end  def add(x,y,icon_name,in_name,name,event_id)    iconb = PlaceIcon.new(x,y,icon_name)    @icons.concat([iconb])    @helps.concat([in_name])    @names.concat([name])    @numbs.concat([event_id])  end  #--------------------------------------------------------------------------  # ● 主处理  #--------------------------------------------------------------------------  def main    # 生成活动块    @spriteset = Spriteset_Map.new    # 生成信息窗口    @message_window = Window_Message.new    # 执行过渡    Graphics.transition    # 主循环    loop do      # 刷新游戏画面      Graphics.update      # 刷新输入信息      Input.update      # 刷新画面      update      # 如果画面切换的话就中断循环      if $scene != self        break      end    end    # 准备过渡    Graphics.freeze    # 释放活动块    @spriteset.dispose    # 释放信息窗口    @message_window.dispose    @sprite.dispose     @help_window.dispose    # 标题画面切换中的情况下    if $scene.is_a?(Scene_Title)      # 淡入淡出画面      Graphics.transition      Graphics.freeze    end  end  #--------------------------------------------------------------------------  # ● 刷新画面  #--------------------------------------------------------------------------  def update    # 循环    loop do      # 按照地图、实例、主角的顺序刷新      # (本更新顺序不会在满足事件的执行条件下成为给予角色瞬间移动      #  的机会的重要因素)      $game_map.update      $game_system.map_interpreter.update      $game_player.update      # 系统 (计时器)、画面刷新      $game_system.update      $game_screen.update      # 如果主角在场所移动中就中断循环      unless $game_temp.player_transferring        break      end      # 执行场所移动      transfer_player      # 处理过渡中的情况下、中断循环      if $game_temp.transition_processing        break      end    end    # 刷新活动块    @spriteset.update    # 刷新信息窗口    @message_window.update    # 游戏结束的情况下    if $game_temp.gameover      # 切换的游戏结束画面      $scene = Scene_Gameover.new      return    end    # 返回标题画面的情况下    if $game_temp.to_title      # 切换到标题画面      $scene = Scene_Title.new      return    end    # 处理过渡中的情况下    if $game_temp.transition_processing      # 清除过渡处理中标志      $game_temp.transition_processing = false      # 执行过渡      if $game_temp.transition_name == ""        Graphics.transition(20)      else        Graphics.transition(40, "Graphics/Transitions/" +          $game_temp.transition_name)      end    end    # 显示信息窗口中的情况下    if $game_temp.message_window_showing      return    end    # 遇敌计数为 0 且、且遇敌列表不为空的情况下    if $game_player.encounter_count == 0 and $game_map.encounter_list != []      # 不是在事件执行中或者禁止遇敌中      unless $game_system.map_interpreter.running? or             $game_system.encounter_disabled        # 确定队伍        n = rand($game_map.encounter_list.size)        troop_id = $game_map.encounter_list[n]        # 队伍有效的话        if $data_troops[troop_id] != nil          # 设置调用战斗标志          $game_temp.battle_calling = true          $game_temp.battle_troop_id = troop_id          $game_temp.battle_can_escape = true          $game_temp.battle_can_lose = false          $game_temp.battle_proc = nil        end      end    end    # 按下 B 键的情况下    if Input.trigger?(Input::B)      # 不是在事件执行中或菜单禁止中      unless $game_system.map_interpreter.running? or             $game_system.menu_disabled        # 设置菜单调用标志以及 SE 演奏        $game_temp.menu_calling = true        $game_temp.menu_beep = true      end    end    # 调试模式为 ON 并且按下 F9 键的情况下    if $DEBUG and Input.press?(Input::F9)      # 设置调用调试标志      $game_temp.debug_calling = true    end    # 不在主角移动中的情况下    unless $game_player.moving?      # 执行各种画面的调用      if $game_temp.battle_calling        call_battle      elsif $game_temp.shop_calling        call_shop      elsif $game_temp.name_calling        call_name      elsif $game_temp.menu_calling        call_menu      elsif $game_temp.save_calling        call_save      elsif $game_temp.debug_calling        call_debug      end    end    ##############################################################    @sprite.bitmap.blt(0,0,@back_bitmap,@back_bitmap.rect)    if $game_system.map_interpreter.running?      return    end    one_is_ready = false    for i in [email protected] - 1      @icons[i].draw(@sprite)      if @icons[i].mouse_in?        @help_window.change_in(@helps[i],@names[i])        one_is_ready = true        if Mouse.key_down(Mouse::LBUTTON)          $game_temp.common_event_id = @numbs[i]          @help_window.visible = false          @help_window.update              return        end      end    end    if one_is_ready == true      @help_window.visible = true    else      @help_window.visible = false    end    @help_window.update    ################################################################  end  #--------------------------------------------------------------------------  # ● 调用战斗  #--------------------------------------------------------------------------  def call_battle    # 清除战斗调用标志    $game_temp.battle_calling = false    # 清除菜单调用标志    $game_temp.menu_calling = false    $game_temp.menu_beep = false    # 生成遇敌计数    $game_player.make_encounter_count    # 记忆地图 BGM 、停止 BGM    $game_temp.map_bgm = $game_system.playing_bgm    $game_system.bgm_stop    # 演奏战斗开始 SE    $game_system.se_play($data_system.battle_start_se)    # 演奏战斗 BGM    $game_system.bgm_play($game_system.battle_bgm)    # 矫正主角姿势    $game_player.straighten    # 切换到战斗画面    $scene = Scene_Battle.new  end  #--------------------------------------------------------------------------  # ● 调用商店  #--------------------------------------------------------------------------  def call_shop    # 清除商店调用标志    $game_temp.shop_calling = false    # 矫正主角姿势    $game_player.straighten    # 切换到商店画面    $scene = Scene_Shop.new  end  #--------------------------------------------------------------------------  # ● 调用名称输入  #--------------------------------------------------------------------------  def call_name    # 清除调用名称输入标志    $game_temp.name_calling = false    # 矫正主角姿势    $game_player.straighten    # 切换到名称输入画面    $scene = Scene_Name.new  end  #--------------------------------------------------------------------------  # ● 调用菜单  #--------------------------------------------------------------------------  def call_menu    # 清除菜单调用标志    $game_temp.menu_calling = false    # 已经设置了菜单 SE 演奏标志的情况下    if $game_temp.menu_beep      # 演奏确定 SE      $game_system.se_play($data_system.decision_se)      # 清除菜单演奏 SE 标志      $game_temp.menu_beep = false    end    # 矫正主角姿势    $game_player.straighten    # 切换到菜单画面    $scene = Scene_Menu.new  end  #--------------------------------------------------------------------------  # ● 调用存档  #--------------------------------------------------------------------------  def call_save    # 矫正主角姿势    $game_player.straighten    # 切换到存档画面    $scene = Scene_Save.new  end  #--------------------------------------------------------------------------  # ● 调用调试  #--------------------------------------------------------------------------  def call_debug    # 清除调用调试标志    $game_temp.debug_calling = false    # 演奏确定 SE    $game_system.se_play($data_system.decision_se)    # 矫正主角姿势    $game_player.straighten    # 切换到调试画面    $scene = Scene_Debug.new  end  #--------------------------------------------------------------------------  # ● 主角的场所移动  #--------------------------------------------------------------------------  def transfer_player    # 清除主角场所移动调试标志    $game_temp.player_transferring = false    # 移动目标与现在的地图有差异的情况下    if $game_map.map_id != $game_temp.player_new_map_id      # 设置新地图      $game_map.setup($game_temp.player_new_map_id)    end    # 设置主角位置    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)    # 设置主角朝向    case $game_temp.player_new_direction    when 2  # 下      $game_player.turn_down    when 4  # 左      $game_player.turn_left    when 6  # 右      $game_player.turn_right    when 8  # 上      $game_player.turn_up    end    # 矫正主角姿势    $game_player.straighten    # 刷新地图 (执行并行事件)    $game_map.update    # 在生成活动块    @spriteset.dispose    @spriteset = Spriteset_Map.new    # 处理过渡中的情况下    if $game_temp.transition_processing      # 清除过渡处理中标志      $game_temp.transition_processing = false      # 执行过渡      Graphics.transition(20)    end    # 执行地图设置的 BGM、BGS 的自动切换    $game_map.autoplay    # 设置画面    Graphics.frame_reset    # 刷新输入信息    Input.update  endend复制代码
    复制代码
    追加定义
    1. class Scene_Map_s  def just_for    @icons = []    @helps = []    @names = []    @numbs = []    if $game_switches[26] == true       add(70,70,"001-weapon01","Awmp_039","common1",1)    end    if $game_switches[27] == true       add(200,300,"002-weapon02","Awmp_006","common2",2)    end        if $game_switches[28] == true       add(40,40,"002-weapon02","Awmp_029","common3",3)    end      if $game_switches[29] == true       add(600,400,"002-weapon02","Awmp_008","common4",4)    end    end  alias old_update update  def update    just_for    old_update  endend复制代码
    复制代码
    因为仅仅是讨论下还有没有什么剩余价值,所以使用方法就略去了吧……




    http://rpg.blue/web/htm/news1214.htm
    vip+2

                  [本贴由 66RPG发布员 于 2008-12-19 23:13:45 进行了编辑]
                 本帖来自P1论坛作者IamI,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=91626  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

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

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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