设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2019|回复: 19
打印 上一主题 下一主题

麻烦脚本高手进来一下!

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
跳转到指定楼层
1
发表于 2008-8-1 12:48:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
2
 楼主| 发表于 2008-8-1 00:51:01 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

史上最强粉丝

梦石
0
星屑
50
在线时间
9 小时
注册时间
2007-8-20
帖子
5574

贵宾

3
发表于 2008-8-1 00:53:09 | 只看该作者
re:主题:《属性升级,删除速度加点!》
直接删除不就好了- -

  1. #==============================================================================

  2. class Scene_Save
  3.   #--------------------------------------------------------------------------
  4.   # ● 写入存档数据
  5.   #     file : 写入用文件对像 (已经打开)
  6.   #--------------------------------------------------------------------------
  7.   def write_save_data(file)
  8.     # 生成描绘存档文件用的角色图形
  9.     characters = []
  10.     for i in 0...[$game_party.actors.size,4].min
  11.       actor = $game_party.actors[i]
  12.       characters.push([actor.character_name, actor.character_hue])
  13.     end
  14.     # 写入描绘存档文件用的角色数据
  15.     Marshal.dump(characters, file)
  16.     # 写入测量游戏时间用画面计数
  17.     Marshal.dump(Graphics.frame_count, file)
  18.     # 增加 1 次存档次数
  19.     $game_system.save_count += 1
  20.     # 保存魔法编号
  21.     # (将编辑器保存的值以随机值替换)
  22.     $game_system.magic_number = $data_system.magic_number
  23.     # 写入各种游戏对像
  24.     Marshal.dump($game_system, file)
  25.     Marshal.dump($game_switches, file)
  26.     Marshal.dump($game_variables, file)
  27.     Marshal.dump($game_self_switches, file)
  28.     Marshal.dump($game_screen, file)
  29.     Marshal.dump($game_actors, file)
  30.     Marshal.dump($game_party, file)
  31.     Marshal.dump($game_troop, file)
  32.     Marshal.dump($game_map, file)
  33.     Marshal.dump($game_player, file)
  34.   end
  35. end

  36. class Scene_Battle
  37.   #--------------------------------------------------------------------------
  38.   # ● 设置物品或特技对像方的战斗者
  39.   #     scope : 特技或者是物品的范围
  40.   #--------------------------------------------------------------------------
  41.   def set_target_battlers(scope)
  42.     # 行动方的战斗者是敌人的情况下
  43.     if @active_battler.is_a?(Game_Enemy)
  44.       # 效果范围分支
  45.       case scope
  46.       when 1  # 敌单体
  47.         index = @active_battler.current_action.target_index
  48.         @target_battlers.push($game_party.smooth_target_actor(index))
  49.       when 2  # 敌全体
  50.         for actor in 0...[$game_party.actors.size,4].min
  51.           if $game_party.actors[actor].exist?
  52.             @target_battlers.push($game_party.actors[actor])
  53.           end
  54.         end
  55.       when 3  # 我方单体
  56.         index = @active_battler.current_action.target_index
  57.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  58.       when 4  # 我方全体
  59.         for enemy in $game_troop.enemies
  60.           if enemy.exist?
  61.             @target_battlers.push(enemy)
  62.           end
  63.         end
  64.       when 5  # 我方单体 (HP 0)
  65.         index = @active_battler.current_action.target_index
  66.         enemy = $game_troop.enemies[index]
  67.         if enemy != nil and enemy.hp0?
  68.           @target_battlers.push(enemy)
  69.         end
  70.       when 6  # 我方全体 (HP 0)
  71.         for enemy in $game_troop.enemies
  72.           if enemy != nil and enemy.hp0?
  73.             @target_battlers.push(enemy)
  74.           end
  75.         end
  76.       when 7  # 使用者
  77.         @target_battlers.push(@active_battler)
  78.       end
  79.     end
  80.     # 行动方的战斗者是角色的情况下
  81.     if @active_battler.is_a?(Game_Actor)
  82.       # 效果范围分支
  83.       case scope
  84.       when 1  # 敌单体
  85.         index = @active_battler.current_action.target_index
  86.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  87.       when 2  # 敌全体
  88.         for enemy in $game_troop.enemies
  89.           if enemy.exist?
  90.             @target_battlers.push(enemy)
  91.           end
  92.         end
  93.       when 3  # 我方单体
  94.         index = @active_battler.current_action.target_index
  95.         @target_battlers.push($game_party.smooth_target_actor(index))
  96.       when 4  # 我方全体
  97.         for actor in 0...[$game_party.actors.size,4].min
  98.           if $game_party.actors[actor].exist?
  99.             @target_battlers.push($game_party.actors[actor])
  100.           end
  101.         end
  102.       when 5  # 我方单体 (HP 0)
  103.         index = @active_battler.current_action.target_index
  104.         actor = $game_party.actors[index]
  105.         if actor != nil and actor.hp0?
  106.           @target_battlers.push(actor)
  107.         end
  108.       when 6  # 我方全体 (HP 0)
  109.         for actor in 0...[$game_party.actors.size,4].min
  110.           if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
  111.             @target_battlers.push($game_party.actors[actor])
  112.           end
  113.         end
  114.       when 7  # 使用者
  115.         @target_battlers.push(@active_battler)
  116.       end
  117.     end
  118.   end  
  119.   #--------------------------------------------------------------------------
  120.   # ● 生成行动循序
  121.   #--------------------------------------------------------------------------
  122.   def make_action_orders
  123.     # 初始化序列 @action_battlers
  124.     @action_battlers = []
  125.     # 添加敌人到 @action_battlers 序列
  126.     for enemy in $game_troop.enemies
  127.       @action_battlers.push(enemy)
  128.     end
  129.     # 添加角色到 @action_battlers 序列
  130.     for actor in 0...[$game_party.actors.size,4].min
  131.       @action_battlers.push($game_party.actors[actor])
  132.     end
  133.     # 确定全体的行动速度
  134.     for battler in @action_battlers
  135.       battler.make_action_speed
  136.     end
  137.     # 按照行动速度从大到小排列
  138.     @action_battlers.sort! {|a,b|
  139.       b.current_action.speed - a.current_action.speed }
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 开始结束战斗回合
  143.   #--------------------------------------------------------------------------
  144.   def start_phase5
  145.     # 转移到回合 5
  146.     @phase = 5
  147.     # 演奏战斗结束 ME
  148.     $game_system.me_play($game_system.battle_end_me)
  149.     # 还原为战斗开始前的 BGM
  150.     $game_system.bgm_play($game_temp.map_bgm)
  151.     # 初始化 EXP、金钱、宝物
  152.     exp = 0
  153.     gold = 0
  154.     treasures = []
  155.     # 循环
  156.     for enemy in $game_troop.enemies
  157.       # 敌人不是隐藏状态的情况下
  158.       unless enemy.hidden
  159.         # 获得 EXP、增加金钱
  160.         exp += enemy.exp
  161.         gold += enemy.gold
  162.         # 出现宝物判定
  163.         if rand(100) < enemy.treasure_prob
  164.           if enemy.item_id > 0
  165.             treasures.push($data_items[enemy.item_id])
  166.           end
  167.           if enemy.weapon_id > 0
  168.             treasures.push($data_weapons[enemy.weapon_id])
  169.           end
  170.           if enemy.armor_id > 0
  171.             treasures.push($data_armors[enemy.armor_id])
  172.           end
  173.         end
  174.       end
  175.     end
  176.     # 限制宝物数为 6 个
  177.     treasures = treasures[0..5]
  178.     # 获得 EXP
  179.     for i in 0...[$game_party.actors.size,4].min
  180.       actor = $game_party.actors[i]
  181.       if actor.cant_get_exp? == false
  182.         last_level = actor.level
  183.         actor.exp += exp
  184.         if actor.level > last_level
  185.           @status_window.level_up(i)
  186.         end
  187.       end
  188.     end
  189.     # 获得金钱
  190.     $game_party.gain_gold(gold)
  191.     # 获得宝物
  192.     for item in treasures
  193.       case item
  194.       when RPG::Item
  195.         $game_party.gain_item(item.id, 1)
  196.       when RPG::Weapon
  197.         $game_party.gain_weapon(item.id, 1)
  198.       when RPG::Armor
  199.         $game_party.gain_armor(item.id, 1)
  200.       end
  201.     end
  202.     # 生成战斗结果窗口
  203.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  204.     # 设置等待计数
  205.     @phase5_wait_count = 0
  206.   end
  207.   
  208.   #--------------------------------------------------------------------------
  209.   # ● 转到输入下一个角色的命令
  210.   #--------------------------------------------------------------------------
  211.   
  212.   def phase3_next_actor
  213.     # 循环
  214.     begin
  215.       # 角色的明灭效果 OFF
  216.       if @active_battler != nil
  217.         @active_battler.blink = false
  218.       end
  219.       # 最后的角色的情况
  220.       if @actor_index == [$game_party.actors.size-1,3].min
  221.         # 开始主回合
  222.         start_phase4
  223.         return
  224.       end
  225.       # 推进角色索引
  226.       @actor_index += 1
  227.       @active_battler = $game_party.actors[@actor_index]
  228.       @active_battler.blink = true
  229.     # 如果角色是在无法接受指令的状态就再试
  230.     end until @active_battler.inputable?
  231.     # 设置角色的命令窗口
  232.     phase3_setup_command_window
  233.   end
  234. end

  235.   
  236.       
  237.       

  238. class Arrow_Actor < Arrow_Base  

  239.   #--------------------------------------------------------------------------
  240.   # ● 刷新画面
  241.   #--------------------------------------------------------------------------
  242.   def update
  243.     super
  244.     # 光标右
  245.     if Input.repeat?(Input::RIGHT)
  246.       $game_system.se_play($data_system.cursor_se)
  247.       @index += 1
  248.       @index %= [$game_party.actors.size,4].min
  249.     end
  250.     # 光标左
  251.     if Input.repeat?(Input::LEFT)
  252.       $game_system.se_play($data_system.cursor_se)
  253.       @index += $game_party.actors.size - 1
  254.       @index %= [$game_party.actors.size,4].min
  255.     end
  256.     # 设置活动块坐标
  257.     if self.actor != nil
  258.       self.x = self.actor.screen_x
  259.       self.y = self.actor.screen_y
  260.     end
  261.   end
  262. end

  263. #==============================================================================
  264. # ■ Window_Target
  265. #------------------------------------------------------------------------------
  266. #  物品画面与特技画面的、使用对像角色选择窗口。
  267. #==============================================================================

  268. class Window_Target < Window_Selectable
  269. #--------------------------------------------------------------------------
  270. # ● 初始化对像
  271. #--------------------------------------------------------------------------
  272. def initialize
  273.    super(0, 0, 336, 480)
  274.    self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
  275.    self.z += 10
  276.    @item_max = $game_party.actors.size
  277.    @top_row = 0
  278.    refresh
  279. end
  280. #--------------------------------------------------------------------------
  281. # ● 刷新
  282. #--------------------------------------------------------------------------
  283. def refresh
  284.    self.contents.clear
  285.    for i in 0...$game_party.actors.size
  286.      x = 4
  287.      y = i * 112
  288.      actor = $game_party.actors[i]
  289.      draw_actor_name(actor, x, y)
  290.      draw_actor_class(actor, x + 144, y)
  291.      draw_actor_level(actor, x + 8, y + 32)
  292.      draw_actor_state(actor, x + 8, y + 64)
  293.      draw_actor_hp(actor, x + 152, y + 32)
  294.      draw_actor_sp(actor, x + 152, y + 64)
  295.    end
  296. end  
  297. #--------------------------------------------------------------------------
  298. # ● 刷新光标矩形
  299. #--------------------------------------------------------------------------
  300. def update_cursor_rect   
  301.    # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
  302.    if @index <= -2
  303.      self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
  304.    elsif @index == -1
  305.      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
  306.    else
  307.      tpy = @index * 112 - self.oy
  308.      self.cursor_rect.set(0, tpy, self.width - 32, 96)
  309.      if @index < @top_row
  310.        @top_row = @index
  311.        self.oy = @top_row *112
  312.      end
  313.      if @index > @top_row+3
  314.        @top_row = @index-3
  315.        self.oy = @top_row *112
  316.      end
  317.    end   
  318. end
  319. end
  320. #==============================================================================
  321. # ■ Window_MenuStatus
  322. #------------------------------------------------------------------------------
  323. #  显示菜单画面和同伴状态的窗口。
  324. #==============================================================================

  325. class Window_MenuStatus < Window_Selectable
  326.   #--------------------------------------------------------------------------
  327.   # ● 初始化目标
  328.   #--------------------------------------------------------------------------
  329.   def initialize
  330.     super(0, 0, 480, 480)
  331.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  332.     refresh
  333.     @top_row = 0
  334.     self.active = false
  335.     self.index = -1
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● 刷新
  339.   #--------------------------------------------------------------------------
  340.   def refresh
  341.     self.contents.clear
  342.     @item_max = $game_party.actors.size
  343.     for i in 0...$game_party.actors.size
  344.       x = 64
  345.       y = i * 112
  346.       if i <=3
  347.         self.contents.font.color = Color.new(255,255,0,255)
  348.         self.contents.draw_text(x,y,340,32,"",2)
  349.         self.contents.font.color = normal_color
  350.       else
  351.         self.contents.font.color = Color.new(128,128,128,255)
  352.         self.contents.draw_text(x,y,340,32,"",2)
  353.         self.contents.font.color = normal_color
  354.       end      
  355.       actor = $game_party.actors[i]
  356.       draw_actor_graphic(actor, x - 40, y + 80)
  357.       draw_actor_name(actor, x, y)
  358.       draw_actor_class(actor, x + 144, y)
  359.       draw_actor_level(actor, x, y + 32)
  360.       draw_actor_state(actor, x + 90, y + 32)
  361.       draw_actor_exp(actor, x, y + 64)
  362.       draw_actor_hp(actor, x + 236, y + 32)
  363.       draw_actor_sp(actor, x + 236, y + 64)
  364.     end
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● 刷新光标矩形
  368.   #--------------------------------------------------------------------------
  369.   def update_cursor_rect
  370.     if @index < 0
  371.       self.cursor_rect.empty
  372.     else
  373.       tpy = @index * 112 - self.oy
  374.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  375.       if @index < @top_row
  376.         @top_row = @index
  377.         self.oy = @top_row *112
  378.       end
  379.       if @index > @top_row+3
  380.         @top_row = @index-3
  381.         self.oy = @top_row *112
  382.       end
  383.     end
  384.   end
  385. end

  386. class Game_Party
  387.   #--------------------------------------------------------------------------
  388.   # ● 全灭判定
  389.   #--------------------------------------------------------------------------
  390.   def all_dead?
  391.     # 同伴人数为 0 的情况下
  392.     if $game_party.actors.size == 0
  393.       return false
  394.     end
  395.     # 同伴中无人 HP 在 0 以上
  396.     for i in 0..3
  397.       if @actors[i] != nil and@actors[i].hp >0
  398.         return false
  399.       end
  400.     end
  401.     # 全灭
  402.     return true
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● 加入同伴
  406.   #     actor_id : 角色 ID
  407.   #--------------------------------------------------------------------------
  408.   def add_actor(actor_id)
  409.     # 获取角色
  410.     actor = $game_actors[actor_id]
  411.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  412.     if not @actors.include?(actor)
  413.       # 添加角色
  414.       @actors.push(actor)
  415.       # 还原主角
  416.       $game_player.refresh
  417.     end
  418.   end
  419. end

  420. #==============================================================================
  421. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  422. #==============================================================================


  423. class Scene_Menu
  424. # --------------------------------
  425.   def initialize(menu_index = 0)
  426.     @menu_index = menu_index
  427.     @changer = 0
  428.     @where = 0
  429.     @checker = 0
  430.   end
  431. # --------------------------------
  432.   def main
  433.     s1 = "   物品"
  434.     s2 = "   特技"
  435.     s3 = "   装备"
  436.     s4 = "   状态"
  437.     s5 = " 储存进度"
  438.     s6 = " 退出游戏"
  439.     s7 = " 调整队伍"
  440.     s8 = " 属性升级"
  441.     s9 = " 人物介绍"
  442.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8, s9])
  443.     @command_window.index = @menu_index
  444.     if $game_party.actors.size == 0
  445.       @command_window.disable_item(0)
  446.       @command_window.disable_item(1)
  447.       @command_window.disable_item(2)
  448.       @command_window.disable_item(3)
  449.     end
  450.     if $game_system.save_disabled
  451.       @command_window.disable_item(4)
  452.     end
  453.     if $game_party.actors.size == 1
  454.       @command_window.disable_item(6)
  455.     end
  456.     @playtime_window = Window_PlayTime.new
  457.     @playtime_window.x = 0
  458.     @playtime_window.y = 320
  459.     @gold_window = Window_Gold.new
  460.     @gold_window.x = 0
  461.     @gold_window.y = 416
  462.     @status_window = Window_MenuStatus.new
  463.     @status_window.x = 160
  464.     @status_window.y = 0
  465.     Graphics.transition
  466.     loop do
  467.       Graphics.update
  468.       Input.update
  469.       update
  470.       if $scene != self
  471.         break
  472.       end
  473.     end
  474.     Graphics.freeze
  475.     @command_window.dispose
  476.     @playtime_window.dispose
  477.     @gold_window.dispose
  478.     @status_window.dispose
  479.   end
  480. # --------------------------------
  481.   def update
  482.     @command_window.update
  483.     @playtime_window.update
  484.     @gold_window.update
  485.     @status_window.update
  486.     if @command_window.active
  487.       update_command
  488.       return
  489.     end
  490.     if @status_window.active
  491.       update_status
  492.       return
  493.     end
  494.   end
  495. # --------------------------------
  496.   def update_command
  497.     if Input.trigger?(Input::B)
  498.       $game_system.se_play($data_system.cancel_se)
  499.       $scene = Scene_Map.new
  500.       return
  501.     end
  502.     if Input.trigger?(Input::C)
  503.       if $game_party.actors.size == 0 and @command_window.index < 4
  504.         $game_system.se_play($data_system.buzzer_se)
  505.         return
  506.       end
  507.       if $game_party.actors.size == 1 and @command_window.index ==6
  508.         $game_system.se_play($data_system.buzzer_se)
  509.         return
  510.       end
  511.       case @command_window.index
  512.       when 0
  513.         $game_system.se_play($data_system.decision_se)
  514.         $scene = Scene_Item.new
  515.       when 1
  516.         $game_system.se_play($data_system.decision_se)
  517.         @command_window.active = false
  518.         @status_window.active = true
  519.         @status_window.index = 0
  520.       when 2
  521.         $game_system.se_play($data_system.decision_se)
  522.         @command_window.active = false
  523.         @status_window.active = true
  524.         @status_window.index = 0
  525.       when 3
  526.         $game_system.se_play($data_system.decision_se)
  527.         @command_window.active = false
  528.         @status_window.active = true
  529.         @status_window.index = 0
  530.       when 4
  531.         if $game_system.save_disabled
  532.           $game_system.se_play($data_system.buzzer_se)
  533.           return
  534.         end
  535.         $game_system.se_play($data_system.decision_se)
  536.         $scene = Scene_Save.new
  537.       when 5
  538.         $game_system.se_play($data_system.decision_se)
  539.         $scene = Scene_End.new
  540.       when 6
  541.         $game_system.se_play($data_system.decision_se)
  542.         @checker = 0
  543.         @command_window.active = false
  544.         @status_window.active = true
  545.         @status_window.index = 0
  546.       when 7
  547.         $game_system.se_play($data_system.decision_se)
  548.         @command_window.active = false
  549.         @status_window.active = true
  550.         @status_window.index = 0
  551.       when 8
  552.         $game_system.se_play($data_system.decision_se)
  553.         @command_window.active = false
  554.         @status_window.active = true
  555.         @status_window.index = 0
  556.       end
  557.       return
  558.     end
  559.   end
  560. # --------------------------------
  561.   def update_status
  562.     if Input.trigger?(Input::B)
  563.       $game_system.se_play($data_system.cancel_se)
  564.       @command_window.active = true
  565.       @status_window.active = false
  566.       @status_window.index = -1
  567.       return
  568.     end
  569.     if Input.trigger?(Input::C)
  570.       case @command_window.index
  571.       when 1
  572.         if $game_party.actors[@status_window.index].restriction >= 2
  573.           $game_system.se_play($data_system.buzzer_se)
  574.           return
  575.         end
  576.         $game_system.se_play($data_system.decision_se)
  577.         $scene = Scene_Skill.new(@status_window.index)
  578.       when 2
  579.         $game_system.se_play($data_system.decision_se)
  580.         $scene = Scene_Equip.new(@status_window.index)
  581.       when 3
  582.         $game_system.se_play($data_system.decision_se)
  583.         $scene = Scene_Status.new(@status_window.index)
  584.       when 6
  585.         $game_system.se_play($data_system.decision_se)
  586.         if @status_window.index==0
  587.           $game_system.se_play($data_system.cancel_se)
  588.           return
  589.         end
  590.         if @checker == 0
  591.           @changer = $game_party.actors[@status_window.index]
  592.           @where = @status_window.index
  593.           @checker = 1
  594.         else
  595.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  596.           $game_party.actors[@status_window.index] = @changer
  597.           @checker = 0
  598.           @status_window.refresh
  599.         end
  600.       when 7
  601.         $game_system.se_play($data_system.decision_se)
  602.         $scene = Scene_Lvup.new(@status_window.index)
  603.       when 8
  604.         $game_system.se_play($data_system.decision_se)
  605.         $scene = Scene_Charactor.new(@status_window.index)
  606.       end
  607.       return
  608.     end
  609.   end
  610. end



  611.     #插件(升级加点,换队伍顺序,人物介绍,动态行走图)

  612. #==============================================================================
  613. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  614. #==============================================================================


  615. # 作者: 柳柳
  616. #
  617. # 说明:这是功能我再比较早期的时候发布在幻森,不过那时候比较笨,方法很糟糕
  618. #       这次是拿上就可以用的。
  619. #
  620. # 感谢:Claimh的脚本使我想起这个功能重做了一遍,本想直接用他的,不过他的算法过分
  621. #       冗余了,没好意思用。
  622. #==============================================================================
  623. # 使用方法:默认情况下把静态图变为了走步图。如果想自行修改,提供功能如下:
  624. #
  625. # 角色走步图:draw_walk_actor_graphic
  626. # 角色转向图:draw_turn_actor_graphic
  627. #
  628. # 回复原有静态角色图:删除100行以后的内容。修改下面这个变量可以更改行走速度
  629. #==============================================================================

  630. WALK_REFRESH_FRAME_SPEED = 10  # 刷新的速度,越大越慢,你可以改为3左右试试看

  631. #==============================================================================
  632. # Window_Base
  633. #==============================================================================
  634. class Window_Base < Window
  635.   #--------------------------------------------------------------------------
  636.   # 初始化方法
  637.   #--------------------------------------------------------------------------
  638.   alias initialize_walk initialize
  639.   def initialize(x, y, width, height)
  640.     initialize_walk(x, y, width, height)
  641.     @start_walk = false
  642.     @turn_index = 0
  643.     @turn_phase = 0
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ★  角色行走图
  647.   #     actor : 角色
  648.   #     x     : 描绘的 X 坐标
  649.   #     y     : 描绘的 Y 坐标
  650.   #--------------------------------------------------------------------------
  651.   def draw_walk_actor_graphic(actor, x, y)
  652.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  653.     cw = bitmap.width / 4
  654.     ch = bitmap.height / 4
  655.     @start_turn = true
  656.     case @turn_phase
  657.     when 0
  658.       x_x = 0
  659.     when 1
  660.       x_x = cw
  661.     when 2
  662.       x_x = cw * 2
  663.     when 3
  664.       x_x = cw * 3
  665.     end
  666.     src_rect = Rect.new(x_x, 0, cw, ch)
  667.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # ★  角色转向图
  671.   #     actor : 角色
  672.   #     x     : 描绘的 X 坐标
  673.   #     y     : 描绘的 Y 坐标
  674.   #--------------------------------------------------------------------------
  675.   def draw_turn_actor_graphic(actor, x, y)
  676.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  677.     cw = bitmap.width / 4
  678.     ch = bitmap.height / 4
  679.     @start_turn = true
  680.     case @turn_phase
  681.     when 0
  682.       x_x = 0
  683.     when 1
  684.       x_x = ch
  685.     when 2
  686.       x_x = ch * 3
  687.     when 3
  688.       x_x = ch * 2
  689.     end
  690.     src_rect = Rect.new(0, x_x, cw, ch)
  691.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   #  更新(可别使用刷新,玩命耗费内存= =)
  695.   #--------------------------------------------------------------------------
  696.   alias walk_update update
  697.   def update
  698.     walk_update
  699.     if @start_turn == false
  700.       @turn_index += 1
  701.       if @turn_index == WALK_REFRESH_FRAME_SPEED
  702.         refresh
  703.         @turn_index = 0
  704.         @turn_phase = (@turn_phase+1)%4
  705.       end
  706.     end
  707.   end  
  708. end

  709. #==============================================================================
  710. # Window_Base
  711. #==============================================================================
  712. class Window_Base < Window
  713.   #--------------------------------------------------------------------------
  714.   # 把原有静态图改为动态走步图
  715.   #--------------------------------------------------------------------------
  716.   def draw_actor_graphic(actor, x, y)
  717.     draw_walk_actor_graphic(actor, x, y)
  718.   end
  719. end

  720. #==============================================================================
  721. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  722. #==============================================================================

  723. #==============================================================================
  724. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  725. #==============================================================================


  726. # 脚本使用设定:

  727. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  728. LEVEL_UP_VARIABLE = 100  # 储存角色点数的变量编号与角色id编号的差值
  729.                          # 默认情况 = 100,
  730.                          # 则是数据库里1号角色的加点数存于101号变量
  731.                          # 3号角色的加点数存于103号变量。
  732.                          # 你可以直接操作变量赠与角色可分配点数

  733. # 每增加一次点数,各项能力值的变化:357-410行
  734.                         
  735. # 使用方法介绍:

  736. # 本脚本不会取代原升级功能 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  737. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  738. # 1-99级全部等于一个相同数值就行了。

  739. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  740. # 默认都是0号

  741. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  742. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new


复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

史上最强粉丝

梦石
0
星屑
50
在线时间
9 小时
注册时间
2007-8-20
帖子
5574

贵宾

4
发表于 2008-8-1 01:00:24 | 只看该作者
re:主题:《属性升级,删除速度加点!》
试试- -两个都复制吧。

  1. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG

  2. #==============================================================================
  3. # ■ Window_Command
  4. #------------------------------------------------------------------------------
  5. #  一般的命令选择行窗口。(追加定义)
  6. #==============================================================================
  7. class Window_Command < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 项目有效化
  10.   #     index : 项目编号
  11.   #--------------------------------------------------------------------------
  12.   def able_item(index)
  13.     draw_item(index, normal_color)
  14.   end
  15. end
  16. #==============================================================================
  17. # ■ Game_Actor
  18. #------------------------------------------------------------------------------
  19. #  处理角色的类。(再定义)
  20. #==============================================================================
  21. class Game_Actor < Game_Battler
  22.   #--------------------------------------------------------------------------
  23.   # ● 更改 EXP
  24.   #     exp : 新的 EXP
  25.   #--------------------------------------------------------------------------
  26.   def exp=(exp)
  27.     @exp = [[exp, 9999999].min, 0].max
  28.     # 升级
  29.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  30.       @level += 1
  31.       # 增加4点可自由分配的点数
  32.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  33.       # 学会特技
  34.       for j in $data_classes[@class_id].learnings
  35.         if j.level == @level
  36.           learn_skill(j.skill_id)
  37.         end
  38.       end
  39.     end
  40.     # 降级
  41.     while @exp < @exp_list[@level]
  42.       @level -= 1
  43.     end
  44.     # 修正当前的 HP 与 SP 超过最大值
  45.     @hp = [@hp, self.maxhp].min
  46.     @sp = [@sp, self.maxsp].min
  47.   end
  48. end
  49. #==============================================================================
  50. # ■ Window_Base
  51. #------------------------------------------------------------------------------
  52. #  游戏中全部窗口的超级类(追加定义)
  53. #==============================================================================
  54. class Window_Base < Window
  55.   #--------------------------------------------------------------------------
  56.   # ● 描绘 HP
  57.   #     actor : 角色
  58.   #     x     : 描画目标 X 坐标
  59.   #     y     : 描画目标 Y 坐标
  60.   #     width : 描画目标的宽
  61.   #--------------------------------------------------------------------------
  62.   def draw_actor_hp_lvup(actor, x, y)
  63.     self.contents.font.color = system_color
  64.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  65.     if $temp_hp == 0
  66.       self.contents.font.color = normal_color
  67.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  68.     else
  69.       maxhp = actor.maxhp + $temp_hp
  70.       self.contents.font.color = Color.new(255, 128, 128, 255)
  71.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  72.       self.contents.font.color = normal_color      
  73.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  74.       if $temp_hp >=0
  75.         self.contents.font.color = Color.new(255, 128, 128, 255)
  76.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  77.       else
  78.         self.contents.font.color = Color.new(255,255,0,255)
  79.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  80.       end
  81.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  82.       self.contents.font.color = normal_color
  83.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  84.     end
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 描绘 SP
  88.   #     actor : 角色
  89.   #     x     : 描画目标 X 坐标
  90.   #     y     : 描画目标 Y 坐标
  91.   #     width : 描画目标的宽
  92.   #--------------------------------------------------------------------------
  93.   def draw_actor_sp_lvup(actor, x, y)
  94.     self.contents.font.color = system_color
  95.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  96.     if $temp_sp == 0
  97.       self.contents.font.color = normal_color
  98.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  99.     else
  100.       maxsp = actor.maxsp + $temp_sp
  101.       self.contents.font.color = Color.new(255, 128, 128, 255)
  102.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  103.       self.contents.font.color = normal_color      
  104.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  105.       if $temp_sp >=0
  106.         self.contents.font.color = Color.new(255, 128, 128, 255)
  107.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  108.       else
  109.         self.contents.font.color = Color.new(255,255,0,255)
  110.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  111.       end
  112.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  113.       self.contents.font.color = normal_color
  114.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  115.     end
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 描绘能力值
  119.   #     actor : 角色
  120.   #     x     : 描画目标 X 坐标
  121.   #     y     : 描画目标 Y 坐标
  122.   #     type  : 能力值种类 (0~4)
  123.   #--------------------------------------------------------------------------
  124.   def draw_actor_lvup(actor, x, y, type)   
  125.     # 定义数字颜色
  126.     lvup = normal_color
  127.     upcolor = Color.new(255, 128, 128, 255)
  128.     self.contents.font.color = normal_color   
  129.     case type
  130.     when 0
  131.       parameter_name = $data_system.words.str
  132.       parameter_value = actor.str
  133.       parameter_value_temp = parameter_value + $temp_str
  134.       if $temp_str != 0
  135.         lvup = upcolor
  136.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  137.         if $temp_str >= 0
  138.           self.contents.font.color = lvup
  139.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  140.         else
  141.           self.contents.font.color = Color.new(255,255,0,255)
  142.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  143.         end        
  144.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  145.         self.contents.font.color = normal_color
  146.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  147.       end
  148.     when 1
  149.       parameter_name = $data_system.words.dex
  150.       parameter_value = actor.dex
  151.       parameter_value_temp = parameter_value + $temp_dex
  152.       if $temp_dex != 0
  153.         lvup = upcolor
  154.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  155.         if $temp_dex >= 0
  156.           self.contents.font.color = lvup
  157.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  158.         else
  159.           self.contents.font.color = Color.new(255,255,0,255)
  160.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  161.         end        
  162.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  163.         self.contents.font.color = normal_color
  164.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  165.       end
  166.     when 2
  167.       parameter_name = $data_system.words.agi
  168.       parameter_value = actor.agi
  169.       parameter_value_temp = parameter_value + $temp_agi
  170.       if $temp_agi != 0
  171.         lvup = upcolor
  172.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  173.         if $temp_agi >= 0
  174.           self.contents.font.color = lvup
  175.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  176.         else
  177.           self.contents.font.color = Color.new(255,255,0,255)
  178.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  179.         end        
  180.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  181.         self.contents.font.color = normal_color
  182.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  183.       end
  184.     when 3
  185.       parameter_name = $data_system.words.int
  186.       parameter_value = actor.int
  187.       parameter_value_temp = parameter_value + $temp_int
  188.       if $temp_int != 0
  189.         lvup = upcolor
  190.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  191.         if $temp_int >= 0
  192.           self.contents.font.color = lvup
  193.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  194.         else
  195.           self.contents.font.color = Color.new(255,255,0,255)
  196.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  197.         end        
  198.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  199.         self.contents.font.color = normal_color
  200.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  201.       end
  202.     when 4
  203.       parameter_name = "剩余属性点数"
  204.       parameter_value = $point
  205.       if $point != 0
  206.         lvup = upcolor
  207.       end
  208.     end   
  209.     self.contents.font.color = system_color
  210.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  211.     self.contents.font.color = normal_color
  212.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  213.     if type != 4
  214.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  215.     end  
  216.     self.contents.font.color = lvup
  217.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  218.     self.contents.font.color = normal_color        
  219.   end
  220. end
  221. #==============================================================================
  222. # ■ Window_lvup
  223. #------------------------------------------------------------------------------
  224. #  显示升级状态窗口。
  225. #==============================================================================
  226. class Window_Lvup < Window_Base
  227.   #--------------------------------------------------------------------------
  228.   # ● 初始化对像
  229.   #     actor : 角色
  230.   #--------------------------------------------------------------------------
  231.   def initialize(actor)
  232.     super(0, 0, 512, 320)
  233.     self.contents = Bitmap.new(width - 32, height - 32)
  234.     @actor = actor
  235.     refresh
  236.   end  
  237.   #--------------------------------------------------------------------------
  238.   # ● 刷新
  239.   #--------------------------------------------------------------------------
  240.   def refresh
  241.     self.contents.clear
  242.     draw_actor_graphic(@actor, 40, 112)
  243.     draw_actor_name(@actor, 4, 0)
  244.     draw_actor_class(@actor, 4 + 144, 0)
  245.     draw_actor_level(@actor, 96, 32)
  246.     draw_actor_state(@actor, 96, 64)   
  247.     draw_actor_hp_lvup(@actor, 96+128, 32)
  248.     draw_actor_sp_lvup(@actor, 96+128, 64)
  249.     draw_actor_lvup(@actor, 96, 128, 0)
  250.     draw_actor_lvup(@actor, 96, 160, 1)
  251.     draw_actor_lvup(@actor, 96, 192, 2)
  252.     draw_actor_lvup(@actor, 96, 224, 3)
  253.     draw_actor_lvup(@actor, 96, 256, 4)
  254.   end
  255. end
  256. #==============================================================================
  257. # ■ Window_Help
  258. #------------------------------------------------------------------------------
  259. #  特技及物品的说明、角色的状态显示的窗口。
  260. #==============================================================================
  261. class Window_Lvup_Help < Window_Base
  262.   #--------------------------------------------------------------------------
  263.   # ● 初始化对像
  264.   #--------------------------------------------------------------------------
  265.   def initialize
  266.     super(0, 320, 640, 160)
  267.     self.contents = Bitmap.new(width - 32, height - 32)
  268.     @test = "" #——这个东西用来检测,节约内存专用
  269.   end  
  270.   #--------------------------------------------------------------------------
  271.   # ● 设置文本
  272.   #--------------------------------------------------------------------------
  273.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  274.     if @test != text1
  275.       @test = text1
  276.     else
  277.       return
  278.     end   
  279.     self.contents.clear
  280.     self.contents.font.color = normal_color
  281.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  282.     if text2 != nil
  283.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  284.     end
  285.     self.contents.font.size -= 4
  286.     if text3 != nil
  287.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  288.     end
  289.     if text4 != nil
  290.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  291.     end
  292.     self.contents.font.size += 4
  293.   end
  294. end
  295. #==============================================================================
  296. # ■ Scene_lvup
  297. #------------------------------------------------------------------------------
  298. #  处理升级画面的类。
  299. #==============================================================================
  300. class Scene_Lvup
  301.   #--------------------------------------------------------------------------
  302.   # ● 初始化对像
  303.   #     actor_index : 角色索引
  304.   #     menu_index : 选项起始位置
  305.   #--------------------------------------------------------------------------
  306.   def initialize(actor_index = 0 , menu_index = 0)
  307.     @actor_index = actor_index
  308.     @menu_index = menu_index
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 主处理
  312.   #--------------------------------------------------------------------------
  313.   def main
  314.     s1 = "  HP"
  315.     s2 = "  STR"
  316.     s3 = "  DEX"
  317.     s4 = "  AGI"
  318.     s5 = "  INT"
  319.     s6 = " 确认加点"
  320.     s7 = " 点数重置"
  321.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  322.     @command_window.index = @menu_index
  323.     # 获取角色
  324.     @actor = $game_party.actors[@actor_index]
  325.     # 将角色的剩余点数带入
  326.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  327.     # 初始化临时量
  328.     $temp_str = 0
  329.     $temp_dex = 0
  330.     $temp_agi = 0
  331.     $temp_int = 0
  332.     $temp_hp = 0
  333.     $temp_sp = 0
  334.     #=========================================================================
  335.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  336.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  337.   #=========================================================================
  338.     # 每提升一次力量,提升多少附加能力
  339.     #=========================================================================
  340.     @str_hp = 5     # 每提升一次力量附加提升多少HP
  341.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  342.     @str_dex = 0    # 每提升一次力量附加提升多少灵巧
  343.     @str_agi = 0    # 每提升一次力量附加提升多少速度
  344.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  345.     @str_str = 1    # 每提升一次力量附加提升多少力量
  346.     #=========================================================================
  347.     # 每提升一次灵巧,提升多少附加能力
  348.     #=========================================================================
  349.     @dex_hp = 1     # 每提升一次灵巧附加提升多少HP
  350.     @dex_sp = 1     # 每提升一次灵巧附加提升多少SP
  351.     @dex_str = 0    # 每提升一次灵巧附加提升多少力量
  352.     @dex_agi = 0    # 每提升一次灵巧附加提升多少速度
  353.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  354.     @dex_dex = 2    # 每提升一次灵巧附加提升多少灵巧
  355.     #=========================================================================
  356.     # 每提升一次魔力,提升多少附加能力
  357.     #=========================================================================
  358.     @int_hp = 0     # 每提升一次魔力附加提升多少HP
  359.     @int_sp = 3    # 每提升一次魔力附加提升多少SP
  360.     @int_str = 0   # 每提升一次魔力附加提升多少力量
  361.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  362.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  363.     @int_int = 1   # 每提升一次魔力附加提升多少魔力
  364.     #=========================================================================
  365.     # 每提升一次体力,提升多少附加能力
  366.     #=========================================================================
  367.     @hp = 10       # 每提升一次体力提升多少HP
  368.     @sp = 0       # 每提升一次体力提升多少SP
  369.     @hp_str = 0   # 每提升一次体力提升多少力量
  370.     @hp_dex = 0   # 每提升一次体力提升多少速度
  371.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  372.     @hp_int = 0   # 每提升一次体力提升多少魔力   
  373.     # 定义说明文字
  374.     @text_hp_sc = "HP可增加角色的最大生命值,延长生存的能力!"
  375.     @text_str_sc = "STR可增加角色的物理攻击力,并大幅度影响绝技的威力!"
  376.     @text_dex_sc = "DEX可增加角色的物理攻击命中率和会心一击的概率!"
  377.     @text_agi_sc = "AGI可增加角色的回避率和逃跑的成功率!"
  378.     @text_int_sc = "INT可增加角色的灵力,并大幅度影响仙术的威力!"
  379.     @text_save = "保存分配情况并返回主菜单"
  380.     @text_reset= "重新分配属性点数"
  381.     @text_2 = ""
  382.     @text_hp = "最大" + $data_system.words.hp + "值"
  383.     @text_sp = "最大" + $data_system.words.sp + "值"
  384.     @text_str = "最大" + $data_system.words.str + "值"
  385.     @text_dex = "最大" + $data_system.words.dex + "值"
  386.     @text_agi = "最大" + $data_system.words.agi + "值"
  387.     @text_int = "最大" + $data_system.words.int + "值"
  388.     s_disable
  389.     # 生成状态窗口
  390.     @lvup_window = Window_Lvup.new(@actor)
  391.     @lvup_window.x = 128
  392.     @lvup_window.y = 0   
  393.     # 生成帮助窗口并初始化帮助文本
  394.     @help_window = Window_Lvup_Help.new   
  395.     # 执行过渡
  396.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  397.     # 主循环
  398.     loop do
  399.       # 刷新游戏画面
  400.       Graphics.update
  401.       # 刷新输入信息
  402.       Input.update
  403.       # 刷新画面
  404.       update
  405.       # 如果切换画面就中断循环
  406.       if $scene != self
  407.         break
  408.       end
  409.     end
  410.     # 准备过渡
  411.     Graphics.freeze
  412.     # 释放窗口
  413.     @command_window.dispose
  414.     @lvup_window.dispose
  415.     @help_window.dispose
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ● 刷新画面
  419.   #--------------------------------------------------------------------------
  420.   def update
  421.     # 刷新窗口
  422.     @command_window.update
  423.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  424.     s_disable
  425.     @lvup_window.update
  426.     #=============================================================
  427.     # 按下 B 键的情况下
  428.     #=============================================================
  429.     if Input.trigger?(Input::B)
  430.       # 演奏取消 SE
  431.       $game_system.se_play($data_system.cancel_se)
  432.       # 切换到地图画面
  433.       $scene = Scene_Menu.new
  434.       return
  435.     end
  436.     #=============================================================
  437.     # 按下 C 键的情况下
  438.     #=============================================================
  439.     if Input.trigger?(Input::C)      
  440.       if @command_window.index == 5
  441.           # 演奏确定 SE
  442.         $game_system.se_play($data_system.decision_se)
  443.         # 将角色的剩余点数带回
  444.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  445.         # 将角色点数实际加上
  446.         @actor.str += $temp_str
  447.         @actor.dex += $temp_dex
  448.         @actor.agi += $temp_agi
  449.         @actor.int += $temp_int
  450.         @actor.maxhp += $temp_hp
  451.         @actor.maxsp += $temp_sp
  452.         # 切换到地图画面
  453.         $scene = Scene_Menu.new
  454.         return
  455.       end
  456.       if @command_window.index == 6
  457.           # 演奏确定 SE
  458.         $game_system.se_play($data_system.cancel_se)
  459.           # 将角色的剩余点数带入
  460.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  461.           # 初始化临时量
  462.         $temp_str = 0
  463.         $temp_dex = 0
  464.         $temp_agi = 0
  465.         $temp_int = 0
  466.         $temp_hp = 0
  467.         $temp_sp = 0
  468.         @lvup_window.refresh
  469.         return
  470.       end
  471.       if $point == 0
  472.         # 演奏冻结 SE
  473.         $game_system.se_play($data_system.buzzer_se)
  474.         return
  475.       end
  476.       case @command_window.index
  477.       when 0
  478.         # 演奏确定 SE
  479.         $game_system.se_play($data_system.decision_se)
  480.         $temp_hp += @hp
  481.         $temp_sp += @sp
  482.         $temp_str += @hp_str
  483.         $temp_dex += @hp_dex
  484.         $temp_agi += @hp_agi
  485.         $temp_int += @hp_int
  486.         $point -= 1
  487.         @lvup_window.refresh
  488.         s_disable
  489.         return
  490.       when 1
  491.         # 演奏确定 SE
  492.         $game_system.se_play($data_system.decision_se)
  493.         $temp_str += @str_str
  494.         $temp_hp += @str_hp
  495.         $temp_sp += @str_sp
  496.         $temp_dex += @str_dex
  497.         $temp_agi += @str_agi
  498.         $temp_int += @str_int
  499.         $point -= 1
  500.         @lvup_window.refresh
  501.         s_disable
  502.         return
  503.       when 2
  504.         # 演奏确定 SE
  505.         $game_system.se_play($data_system.decision_se)
  506.         $temp_dex += @dex_dex
  507.         $temp_hp += @dex_hp
  508.         $temp_sp += @dex_sp
  509.         $temp_str += @dex_str
  510.         $temp_agi += @dex_agi
  511.         $temp_int += @dex_int
  512.         $point -= 1
  513.         @lvup_window.refresh
  514.         s_disable
  515.         return
  516.       when 3
  517.         # 演奏确定 SE
  518.         $game_system.se_play($data_system.decision_se)
  519.         $temp_agi += @agi_agi
  520.         $temp_hp += @agi_hp
  521.         $temp_sp += @agi_sp
  522.         $temp_str += @agi_str
  523.         $temp_dex += @agi_dex
  524.         $temp_int += @agi_int
  525.         $point -= 1
  526.         @lvup_window.refresh
  527.         s_disable
  528.         return
  529.       when 4
  530.         # 演奏确定 SE
  531.         $game_system.se_play($data_system.decision_se)
  532.         $temp_int += @int_int
  533.         $temp_hp += @int_hp
  534.         $temp_sp += @int_sp
  535.         $temp_str += @int_str
  536.         $temp_dex += @int_dex
  537.         $temp_agi += @int_agi
  538.         $point -= 1
  539.         @lvup_window.refresh
  540.         s_disable
  541.         return
  542.       end
  543.     end
  544.     #=============================================================
  545.     # 什么都没有按下的情况
  546.     #=============================================================
  547.     case @command_window.index   
  548.     when 0  # 增加体力
  549.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  550.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  551.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  552.     when 1  # 增加力量
  553.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  554.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  555.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  556.     when 2  # 增加灵巧
  557.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  558.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  559.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  560.     when 3  # 增加魔力
  561.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  562.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  563.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  564.     when 4 # 保存设定
  565.       @help_window.lvup_text(@text_save)
  566.     when 5 # 点数重置
  567.       @help_window.lvup_text(@text_reset)     
  568.     end
  569.     #=============================================================
  570.     # 按下R与L换人的情况
  571.     #=============================================================      
  572.     if Input.trigger?(Input::R)
  573.       # 演奏光标 SE
  574.       $game_system.se_play($data_system.cursor_se)
  575.       # 移至下一位角色
  576.       @actor_index += 1
  577.       @actor_index %= $game_party.actors.size
  578.       # 切换到别的状态画面
  579.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  580.       return
  581.     end
  582.     # 按下 L 键的情况下
  583.     if Input.trigger?(Input::L)
  584.       # 演奏光标 SE
  585.       $game_system.se_play($data_system.cursor_se)
  586.       # 移至上一位角色
  587.       @actor_index += $game_party.actors.size - 1
  588.       @actor_index %= $game_party.actors.size
  589.       # 切换到别的状态画面
  590.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  591.       return
  592.     end
  593.   end  
  594.   #--------------------------------------------------------------------------
  595.   # ● 选项明暗判断
  596.   #--------------------------------------------------------------------------
  597.   def s_disable
  598.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  599.     if $point == 0
  600.       @command_window.disable_item(0)
  601.       @command_window.disable_item(1)
  602.       @command_window.disable_item(2)
  603.       @command_window.disable_item(3)
  604.       @command_window.disable_item(4)
  605.     else
  606.       @command_window.able_item(0)
  607.       @command_window.able_item(1)      
  608.       @command_window.able_item(2)
  609.       @command_window.able_item(3)
  610.       @command_window.able_item(4)
  611.     end
  612.   end
  613. end

  614. #==============================================================================
  615. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  616. #==============================================================================

  617. #==============================================================================
  618. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  619. #==============================================================================


  620. # 人物介绍     Ver. 1.1          作者: Claimh     翻译与修正:柳柳
  621. #------------------------------------------------------------------------------
  622. # http://www.k3.dion.ne.jp/~claimh/
  623. #==============================================================================
  624.   
  625.   #——功能简介:在状态页面按下回车键会进入人物介绍页面。
  626.   #——如果想自行建立功能,使用$scene = Scene_Charactor(角色编号).new即可
  627.   #——如果自行建立了功能不想使用默认的切换,去掉217行以后的内容
  628.   
  629.   #——以下数组,如果人物超过8人,请自行继续添加(一般游戏没那么多主人公吧)
  630.   #——如果想更改内容,比如把“体重”改为“智商”,请修改102-107行的文字内容
  631.   
  632.   # 从状态页面切换至人物介绍页面的按键
  633.   CHENGE_KEY = Input::C
  634.   #--------------------------------------------------------------------------
  635.   # 人物年龄 (自定义)
  636.   #--------------------------------------------------------------------------
  637.   CHARA_AGE = ["20","19","17","??","??","??","15","15"]
  638.   #--------------------------------------------------------------------------
  639.   # 人物性格
  640.   #--------------------------------------------------------------------------
  641.   CHARA_FROM = ["幽默风趣","外柔内刚","嫉恶如仇","??","??","??","雷都","日本东京"]
  642.   #--------------------------------------------------------------------------
  643.   # 人物属性
  644.   #--------------------------------------------------------------------------
  645.   CHARA_H = ["不详","土","木","??","??","??","162","165"]
  646.   #--------------------------------------------------------------------------
  647.   # 人物门派
  648.   #--------------------------------------------------------------------------
  649.   CHARA_W = ["不详","天宗派","灵霄派","??","??","??","46","53"]
  650.   #--------------------------------------------------------------------------
  651.   # 人物介绍,可以写多行
  652.   #--------------------------------------------------------------------------
  653.   # 人物1号介绍
  654.   L1 = "身世不明,对自己的过去一无所知,是一个外表看来"
  655.   L2 = "不经世事,内心却充满着正义与向往的少年."
  656.   L3 = ""               
  657.   L_SET1 = [L1, L2, L3]  # 人物1号的数组
  658.   # 人物2号介绍
  659.   L1 = "天宗派青卢真人的徒弟,为人十分友善.是一外表看似"
  660.   L2 = "柔弱,但内心却无比坚强的女孩."
  661.   L3 = ""
  662.   L_SET2 = [L1, L2, L3]  # 人物2号的数组
  663.   # 人物3号介绍
  664.   L1 = "天宗派青卢真人的徒弟,为人十分友善,是一个外表看"
  665.   L2 = "似柔弱,但内心却无比坚强的女孩."
  666.   L3 = ""
  667.   L_SET2 = [L1, L2, L3]  # 人物2号的数组
  668.   # 人物3号介绍
  669.   L1 = "史上最强的狂战士"
  670.   L2 = ""
  671.   L3 = ""
  672.   L_SET3 = [L1, L2, L3]
  673.   # 人物4号介绍
  674.   L1 = "年青的盗贼,冷血到无法言比喻"
  675.   L2 = "她执行任务从来没失败过"
  676.   L3 = "因为据说所有不小心见到她偷盗的人,都被一剑穿心"
  677.   L_SET4 = [L1, L2, L3]
  678.   # 人物5号介绍
  679.   L1 = "“如果有一天,鹤雪不在了,你还在”"
  680.   L2 = "“如果有一天,你不在了”"
  681.   L3 = "“——之要你的威名仍在,天下就仍存在着希望”"
  682.   L_SET5 = [L1, L2, L3]
  683.   # 人物6号介绍
  684.   L1 = "富家公子,战斗技能很差,只会用枪防身"
  685.   L2 = ""
  686.   L3 = ""
  687.   L_SET6 = [L1, L2, L3]
  688.   # 人物7号介绍
  689.   L1 = "充满冷酷的红魔法师"
  690.   L2 = "11岁,父母阵亡后加入了杀手组织"
  691.   L3 = "13岁,在一次行动失利中被抓到地牢严刑拷打长达半年"
  692.   L4 = "14岁,一个人杀光所有蹂躏她的狱卒,独自踏上旅途"
  693.   L_SET7 = [L1, L2, L3, L4]
  694.   # 人物8号介绍
  695.   L1 = "娇生惯养的贵族魔法师,从不懂人世艰难"
  696.   L2 = "自以为实力天下第一"
  697.   L3 = ""
  698.   L_SET8 = [L1, L2, L3]

  699.   # 人物介绍数组,如果不够继续添加。
  700.   CHARA_INFO = [L_SET1,L_SET2,L_SET3,L_SET4,L_SET5,L_SET6,L_SET7,L_SET8]


  701. #==============================================================================
  702. # Window_Charactor
  703. #==============================================================================

  704. class Window_Charactor < Window_Base
  705.   #--------------------------------------------------------------------------
  706.   # actor : 初始化的角色
  707.   #--------------------------------------------------------------------------
  708.   def initialize(actor)
  709.     super(0, 0, 640, 480)
  710.     self.contents = Bitmap.new(width - 32, height - 32)
  711.     @actor = actor
  712.     refresh
  713.   end
  714.   #--------------------------------------------------------------------------
  715.   #--------------------------------------------------------------------------
  716.   def refresh
  717.     self.contents.clear
  718.     draw_battler_graphics(@actor, 100, 200)
  719.     self.contents.font.color.set(255, 255,50)
  720.     self.contents.draw_text(250, 10, 80, 32, "姓名")
  721.     self.contents.draw_text(250, 50, 80, 32, "年龄")
  722.     self.contents.draw_text(250, 90, 80, 32, "性格")
  723.     self.contents.draw_text(250, 130, 80, 32, "属性")
  724.     self.contents.draw_text(250, 170, 80, 32, "门派")
  725.     self.contents.font.color = normal_color
  726.     draw_actor_name(@actor, 350, 10)
  727.     draw_actor_age(@actor, 350, 50)
  728.     draw_actor_from(@actor, 350, 90)
  729.     draw_actor_height(@actor, 350, 130)   
  730.     draw_actor_weight(@actor, 350, 170)
  731.     draw_actor_other(@actor, 50, 250)
  732.   end
  733. end

  734. class Window_Base < Window
  735.   #--------------------------------------------------------------------------
  736.   #--------------------------------------------------------------------------
  737.   def draw_battler_graphics(actor, x, y)
  738.     battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  739.     w = battler.width
  740.     h = battler.height
  741.     self.contents.blt(x-w/2, y-h, battler, Rect.new(0, 0, w,h))
  742.   end

  743.   #--------------------------------------------------------------------------
  744.   #--------------------------------------------------------------------------
  745.   def draw_actor_age(actor, x, y)
  746.     self.contents.draw_text(x, y, 80, 32, CHARA_AGE[actor.id-1])
  747.   end

  748.   #--------------------------------------------------------------------------
  749.   #--------------------------------------------------------------------------
  750.   def draw_actor_from(actor, x, y)
  751.     self.contents.draw_text(x, y, 180, 32, CHARA_FROM[actor.id-1])
  752.   end

  753.   #--------------------------------------------------------------------------
  754.   #--------------------------------------------------------------------------
  755.   def draw_actor_height(actor, x, y)
  756.     self.contents.draw_text(x, y , 200, 32, CHARA_H[actor.id-1])
  757.   end

  758.   #--------------------------------------------------------------------------
  759.   #--------------------------------------------------------------------------
  760.   def draw_actor_weight(actor, x, y)
  761.     self.contents.draw_text(x, y, 250, 32, CHARA_W[actor.id-1])
  762.   end

  763.   #--------------------------------------------------------------------------
  764.   #--------------------------------------------------------------------------
  765.   def draw_actor_other(actor, x, y)
  766.     info = CHARA_INFO[actor.id-1]
  767.     for i in 0...info.size
  768.       self.contents.draw_text(x, y+32*i, 600, 32, info[i])
  769.     end
  770.   end
  771. end


  772. #==============================================================================
  773. # Scene_Charactor
  774. #==============================================================================

  775. class Scene_Charactor
  776.   #--------------------------------------------------------------------------
  777.   #   actor_index :角色编号
  778.   #--------------------------------------------------------------------------
  779.   def initialize(actor_index = 0, equip_index = 0)
  780.     @actor_index = actor_index
  781.   end
  782.   #--------------------------------------------------------------------------
  783.   #--------------------------------------------------------------------------
  784.   def main
  785.     @actor = $game_party.actors[@actor_index]
  786.     @status_window = Window_Charactor.new(@actor)
  787.     Graphics.transition
  788.     loop do
  789.       Graphics.update
  790.       Input.update
  791.       update
  792.       if $scene != self
  793.         break
  794.       end
  795.     end
  796.     Graphics.freeze
  797.     @status_window.dispose
  798.   end
  799.   #--------------------------------------------------------------------------
  800.   #--------------------------------------------------------------------------
  801.   def update
  802.     if Input.trigger?(Input::B)
  803.       $game_system.se_play($data_system.cancel_se)
  804.       $scene = Scene_Menu.new(8)
  805.       return
  806.     end
  807.     if Input.trigger?(Input::R)
  808.       $game_system.se_play($data_system.cursor_se)
  809.       @actor_index += 1
  810.       @actor_index %= $game_party.actors.size
  811.       $scene = Scene_Charactor.new(@actor_index)
  812.       return
  813.     end
  814.     if Input.trigger?(Input::L)
  815.       $game_system.se_play($data_system.cursor_se)
  816.       @actor_index += $game_party.actors.size - 1
  817.       @actor_index %= $game_party.actors.size
  818.       $scene = Scene_Charactor.new(@actor_index)
  819.       return
  820.     end
  821.   end
  822. end


  823. #==============================================================================
  824. # Scene_Status
  825. #==============================================================================

  826. class Scene_Status
  827.   alias update_chara update
  828.   def update
  829.     if Input.trigger?(CHENGE_KEY)
  830.       $game_system.se_play($data_system.decision_se)
  831.       $scene = Scene_Charactor.new(@actor_index)
  832.       return
  833.     end
  834.     update_chara
  835.   end
  836. end
复制代码
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
5
 楼主| 发表于 2008-8-1 01:25:46 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
6
 楼主| 发表于 2008-8-1 03:25:33 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
40028
在线时间
5816 小时
注册时间
2006-11-10
帖子
6691
7
发表于 2008-8-1 03:34:10 | 只看该作者
re:主题:《属性升级,删除速度加点!》
先把
s1 = "  HP"
    s2 = "  STR"
    s3 = "  DEX"
    s4 = "  AGI"
    s5 = "  INT"
    s6 = " 确认加点"
    s7 = " 点数重置"
    @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
这里的S3去掉,整理下后面的(就是s4改S3,S5改S4...)
下面的中括号里去掉s7

然后,找到这段,删掉,同样整理下后面的4.5.6...
when 3  # 增加速度
      temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
      temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
      @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)

应该可以了= =...如果还有什么漏的,自己看着整理下...我也不会说了~~
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
8
 楼主| 发表于 2008-8-1 04:24:36 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
433 小时
注册时间
2007-5-1
帖子
993
9
发表于 2008-8-1 04:30:12 | 只看该作者
re:主题:《属性升级,删除速度加点!》
when 4 改成 when 3
when 5 改成 when 4
when 6 改成 when 5

嗯,不能浪费签名了,打广告。本人的悲剧作品:
坑化游戏《龙之影》      R剧《星空》     小游戏《剑与拳头》
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-29
帖子
511
10
 楼主| 发表于 2008-8-1 05:13:45 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-11 04:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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