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

Project1

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

[转载] 【猎奇】cobbtocs脚本整合

[复制链接]

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
跳转到指定楼层
1
发表于 2012-3-16 10:44:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 无双sxa 于 2012-3-16 12:34 编辑

来源:http://cobbtocs.co.uk/wp
  1. =begin
  2. Learn Skills by Element use
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  9. Allows you to learn new skills by using skills of the same element.
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. You will need to edit module Fomar, further instructions
  14. are located there.
  15. ----------------------
  16. Known bugs
  17. ----------------------
  18. None
  19. =end
  20. module Fomar

  21.   ELEMENTS = []
  22.   # Add/Edit lines like the ones below
  23.   ELEMENTS[3] = {}
  24.   # ELEMENTS[id][uses] = [NEW_SKILL_ID, NEW_SKILL_ID...]
  25.   ELEMENTS[3][50]  = [52,53]
  26.   ELEMENTS[3][100] = [54]

  27. end

  28. class Game_Actor < Game_Battler
  29.   #--------------------------------------------------------------------------
  30.   # ● Aliases setup
  31.   #--------------------------------------------------------------------------
  32.   alias seu_setup setup
  33.   def setup(actor_id)
  34.     seu_setup(actor_id)
  35.     @element_uses = []
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● New Method add_element_use
  39.   #--------------------------------------------------------------------------
  40.   def add_element_use(id)
  41.     if @element_uses[id] == nil
  42.       @element_uses[id] = 0
  43.     end
  44.     @element_uses[id] += 1
  45.     unless Fomar::ELEMENTS[id][@element_uses[id]] == nil
  46.       for skill in Fomar::ELEMENTS[id][@element_uses[id]]
  47.         learn_skill(skill)
  48.         $game_message.add(@name + ' learns ' + $data_skills[skill].name)
  49.       end
  50.     end
  51.   end
  52. end

  53. class Game_Battler < Game_BattlerBase
  54.   #--------------------------------------------------------------------------
  55.   # ● Aliases item_apply
  56.   #--------------------------------------------------------------------------
  57.   alias seu_item_apply item_apply
  58.   def item_apply(user, item)
  59.     seu_item_apply(user, item)
  60.     if user.is_a?(Game_Actor) and item.is_a?(RPG::Skill)
  61.       user.add_element_use(item.damage.element_id)
  62.     end
  63.   end
  64. end
复制代码
多次使用某种五灵属性的仙术后会自动学到高级仙术。
无法实现五灵复合。

评分

参与人数 1星屑 +100 收起 理由
无双sxa + 100 感谢分享。

查看全部评分

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
2
 楼主| 发表于 2012-3-16 10:48:32 | 只看该作者

【转载哦亲!】无限等级

本帖最后由 杂兵天下 于 2012-3-16 14:50 编辑

真正的无限等级破限
来源http://cobbtocs.co.uk/wp/
RUBY 代码复制
  1. =begin
  2. Infinite Levels
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Instructions
  7. ----------------------
  8. In the class tab of the database you will need to set the stats up
  9. differantly to what you're used to, the stat at level one is the base
  10. stat for a level one character as you would expect.
  11. But the stat for level two is now how much you would like the stat to
  12. go up by each level.
  13.  
  14. Also edit max level below to your liking.
  15. ----------------------
  16. Known bugs
  17. ----------------------
  18. None
  19. =end
  20. class Game_Actor < Game_Battler
  21.   #--------------------------------------------------------------------------
  22.   # ● Feel free to edit
  23.   #--------------------------------------------------------------------------
  24.   def max_level
  25.     return @level + 1
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● Formula for stats
  29.   #--------------------------------------------------------------------------
  30.   alias pbpoxian param_base
  31.   def param_base(param_id)
  32.     if @level > 99
  33.       b = self.class.params[param_id, 1]
  34.       i = self.class.params[param_id, 2]
  35.       return b + i * (@level - 1)
  36.     else
  37.       return pbpoxian(param_id)
  38.     end
  39.   end
  40. end
签名是什么?可以吃么?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
3
 楼主| 发表于 2012-3-16 10:51:20 | 只看该作者

【猎奇】奇怪的战斗系统,待会研究下

本帖最后由 杂兵天下 于 2012-3-16 14:59 编辑

来源http://cobbtocs.co.uk/wp/
  1. =begin
  2. Customisable ATB/Stamina Based Battle System Script
  3. by Fomar0153
  4. Version 1.2
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  9. Customises the battle system to be similar to
  10. ATB or Stamina based battle systems.
  11. ----------------------
  12. Instructions
  13. ----------------------
  14. Edit variables in CBS to suit your needs.
  15. The guard status should be set to 2~2 turns.
  16. ----------------------
  17. Change Log
  18. ----------------------
  19. 1.0 -> 1.1 Restored turn functionality and a glitch
  20.            related to message windows
  21. 1.1 -> 1.2 Added CTB related options
  22.            Added the ability to pass a turn
  23.            Fixed a bug which caused an error on maps
  24.            with no random battles
  25.            Added options for turn functionality to be based on time
  26.            or number of actions
  27.            Added the ability to change the bar colours based on states
  28. ----------------------
  29. Known bugs
  30. ----------------------
  31. None
  32. =end
  33. module CBS

  34.   MAX_STAMINA = 1000
  35.   RESET_STAMINA = true
  36.   
  37.   # If ATB is set to false then the bars won't appear and
  38.   # the pauses where the bars would be filling up are removed
  39.   # effectively turning this into a CTB system
  40.   ATB = true
  41.   SAMINA_GAUGE_NAME = "ATB"
  42.   ENABLE_PASSING = true
  43.   PASSING_COST = 200
  44.   
  45.   # If seconds per turn is set to 0 then a turn length will be
  46.   # decided on number of actions
  47.   TURN_LENGTH = 4
  48.   
  49.   ESCAPE_COST = 500
  50.   # If reset stamina is set to true then all characters
  51.   # will start with a random amount of stamina capped at
  52.   # the percentage you set.
  53.   # If reset stamina is set to false then this just
  54.   # affects enemies.
  55.   STAMINA_START_PERCENT = 20

  56.   # Default skill cost
  57.   # If you want to customise skill costs do it like this
  58.   # SKILL_COST[skill_id] = cost
  59.   SKILL_COST = []
  60.   SKILL_COST[0] = 1000
  61.   # Attack
  62.   SKILL_COST[1] = 1000
  63.   # Guard
  64.   SKILL_COST[2] = 500
  65.   ITEM_COST = 1000

  66.   # If you prefer to have states handle agility buffs then set STATES_HANDLE_AGI to true
  67.   STATES_HANDLE_AGI = false
  68.   # In the following section mult means the amount you multiply stamina gains by
  69.   # if STATES_HANDLE_AGI is set to true then it is only used to determine bar color
  70.   # with debuffs taking precedence over buffs
  71.   STAMINA_STATES = []
  72.   # Default colour
  73.   STAMINA_STATES[0] = [1,31,32]
  74.   # in the form
  75.   # STAMINA_STATES[STATE_ID] = [MULT,FILL_COLOUR,EMPTY_COLOR]
  76.   # e.g. Haste
  77.   STAMINA_STATES[10] = [2,4,32]
  78.   # e.g. Stop  
  79.   STAMINA_STATES[11] = [0,8,32]
  80.   # e.g. Slow  
  81.   STAMINA_STATES[12] = [0.5,8,32]

  82.   #--------------------------------------------------------------------------
  83.   # ● New Method stamina_gain
  84.   #--------------------------------------------------------------------------
  85.   def self.stamina_gain(battler)
  86.     return ((2 + [0, battler.agi / 10].max) * self.stamina_mult(battler)).to_i
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● New Method stamina_gain
  90.   #--------------------------------------------------------------------------
  91.   def self.stamina_mult(battler)
  92.     return 1 if STATES_HANDLE_AGI
  93.     mult = STAMINA_STATES[0][0]
  94.     for state in battler.states
  95.       unless STAMINA_STATES[state.id].nil?
  96.         mult *= STAMINA_STATES[state.id][0]
  97.       end
  98.     end
  99.     return mult
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● New Method stamina_gain
  103.   #--------------------------------------------------------------------------
  104.   def self.stamina_colors(battler)
  105.     colors = STAMINA_STATES[0]
  106.     for state in battler.states
  107.       unless STAMINA_STATES[state.id].nil?
  108.         if STAMINA_STATES[state.id][0] < colors[0] or colors[0] == 1
  109.           colors = STAMINA_STATES[state.id]
  110.         end
  111.       end
  112.     end
  113.     return colors
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● New Method stamina_start
  117.   #--------------------------------------------------------------------------
  118.   def self.stamina_start(battler)
  119.     battler.stamina = rand(MAX_STAMINA * STAMINA_START_PERCENT / 100)
  120.   end
  121. end

  122. class Game_BattlerBase
  123.   #--------------------------------------------------------------------------
  124.   # ● New attr_accessor
  125.   #--------------------------------------------------------------------------
  126.   attr_accessor :stamina
  127.   #--------------------------------------------------------------------------
  128.   # ● Aliases initialize
  129.   #--------------------------------------------------------------------------
  130.   alias cbs_initialize initialize
  131.   def initialize
  132.     cbs_initialize
  133.     @stamina = 0
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● New Method stamina_rate
  137.   #--------------------------------------------------------------------------
  138.   def stamina_rate
  139.     @stamina.to_f / CBS::MAX_STAMINA
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● New Method stamina_rate
  143.   #--------------------------------------------------------------------------
  144.   def stamina_gain
  145.     return if not movable?
  146.     @stamina = [CBS::MAX_STAMINA, @stamina + CBS.stamina_gain(self)].min
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● New Method stamina_color
  150.   #--------------------------------------------------------------------------
  151.   def stamina_color
  152.     for state in @states
  153.       unless CBS::STAMINA_STATES[state].nil?
  154.         return STAMINA_STATES[state]
  155.       end
  156.     end
  157.     return STAMINA_STATES[0]
  158.   end
  159. end

  160. #--------------------------------------------------------------------------
  161. # ● New Class Window_PartyHorzCommand
  162. #--------------------------------------------------------------------------
  163. class Window_PartyHorzCommand < Window_HorzCommand
  164.   #--------------------------------------------------------------------------
  165.   # ● New Method initialize
  166.   #--------------------------------------------------------------------------
  167.   def initialize
  168.     super(0, 0)
  169.     self.openness = 0
  170.     deactivate
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● New Method window_width
  174.   #--------------------------------------------------------------------------
  175.   def window_width
  176.     return Graphics.width
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● New Method visible_line_number
  180.   #--------------------------------------------------------------------------
  181.   def visible_line_number
  182.     return 1
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● New Method make_command_list
  186.   #--------------------------------------------------------------------------
  187.   def make_command_list
  188.     add_command(Vocab::fight,  :fight)
  189.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● New Method setup
  193.   #--------------------------------------------------------------------------
  194.   def setup
  195.     clear_command_list
  196.     make_command_list
  197.     refresh
  198.     select(0)
  199.     activate
  200.     open
  201.   end
  202. end

  203. class Scene_Battle < Scene_Base
  204.   #--------------------------------------------------------------------------
  205.   # ● Rewrote update
  206.   #--------------------------------------------------------------------------
  207.   def update
  208.     super
  209.     if (CBS::ENABLE_PASSING and @actor_command_window.active) and Input.press?(:A)
  210.       command_pass
  211.     end
  212.     if BattleManager.in_turn? and !inputting?
  213.       while @subject.nil? and !CBS::ATB
  214.         process_stamina
  215.       end
  216.       if CBS::ATB
  217.         process_stamina
  218.       end
  219.       process_event
  220.       process_action
  221.     end
  222.     BattleManager.judge_win_loss
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● New Method inputting?
  226.   #--------------------------------------------------------------------------
  227.   def inputting?
  228.     return @actor_command_window.active || @skill_window.active ||
  229.       @item_window.active || @actor_window.active || @enemy_window.active
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● New Method process_stamina
  233.   #--------------------------------------------------------------------------
  234.   def process_stamina
  235.     @actor_command_window.close
  236.     return if @subject
  237.     BattleManager.advance_turn
  238.     all_battle_members.each do |battler|
  239.       battler.stamina_gain
  240.     end
  241.     @status_window.refresh
  242.     if @status_window.close?
  243.       @status_window.open
  244.     end
  245.     if BattleManager.escaping?
  246.       $game_party.battle_members.each do |battler|
  247.         if battler.stamina < CBS::MAX_STAMINA
  248.           $game_troop.members.each do |enemy|
  249.             if enemy.stamina == CBS::MAX_STAMINA
  250.               enemy.make_actions
  251.               @subject = enemy
  252.             end
  253.           end
  254.           return
  255.         end
  256.       end
  257.       unless BattleManager.process_escape
  258.         $game_party.battle_members.each do |actor|
  259.           actor.stamina -= CBS::ESCAPE_COST
  260.         end
  261.       end
  262.     end
  263.     all_battle_members.each do |battler|
  264.       if battler.stamina == CBS::MAX_STAMINA
  265.         battler.make_actions
  266.         @subject = battler
  267.         if @subject.inputable? and battler.is_a?(Game_Actor)
  268.           @actor_command_window.setup(@subject)
  269.           BattleManager.set_actor(battler)
  270.         end
  271.         return
  272.       end
  273.     end
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● Rewrote create_info_viewport
  277.   #--------------------------------------------------------------------------
  278.   def create_info_viewport
  279.     @info_viewport = Viewport.new
  280.     @info_viewport.rect.y = Graphics.height - @status_window.height - 48
  281.     @info_viewport.rect.height = @status_window.height + 48
  282.     @info_viewport.z = 100
  283.     @info_viewport.ox = 0
  284.     @status_window.viewport = @info_viewport
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● Rewrote create_party_command_window
  288.   #--------------------------------------------------------------------------
  289.   def create_party_command_window
  290.     @party_command_window = Window_PartyHorzCommand.new
  291.     @party_command_window.viewport = @info_viewport
  292.     @party_command_window.set_handler(:fight,  method(:command_fight))
  293.     @party_command_window.set_handler(:escape, method(:command_escape))
  294.     @party_command_window.unselect
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● Rewrote create_status_window
  298.   #--------------------------------------------------------------------------
  299.   def create_status_window
  300.     @status_window = Window_BattleStatus.new
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● Rewrote create_actor_command_window
  304.   #--------------------------------------------------------------------------
  305.   def create_actor_command_window
  306.     @actor_command_window = Window_ActorCommand.new
  307.     @actor_command_window.viewport = @info_viewport
  308.     @actor_command_window.set_handler(:attack, method(:command_attack))
  309.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  310.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  311.     @actor_command_window.set_handler(:item,   method(:command_item))
  312.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  313.     @actor_command_window.x = Graphics.width - 128
  314.     @actor_command_window.y = 48
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # ● Destroyed update_info_viewport
  318.   #--------------------------------------------------------------------------
  319.   def update_info_viewport
  320.     # no thank you
  321.   end
  322. #--------------------------------------------------------------------------
  323.   # ● Rewrote start_party_command_selection
  324.   #--------------------------------------------------------------------------
  325.   def start_party_command_selection
  326.     unless scene_changing?
  327.       refresh_status
  328.       @status_window.unselect
  329.       @status_window.open
  330.       if BattleManager.input_start
  331.         @actor_command_window.close
  332.         @party_command_window.setup
  333.       else
  334.         @party_command_window.deactivate
  335.         turn_start
  336.       end
  337.     end
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● Rewrote start_actor_command_selection
  341.   #--------------------------------------------------------------------------
  342.   def start_actor_command_selection
  343.     @party_command_window.close
  344.     BattleManager.set_escaping(false)
  345.     turn_start
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ● Rewrote prior_command
  349.   #--------------------------------------------------------------------------
  350.   def prior_command
  351.     start_party_command_selection
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ● Rewrote process_action
  355.   #--------------------------------------------------------------------------
  356.   def process_action
  357.     return if scene_changing?
  358.     if !@subject || [email protected]_action
  359.       @subject = BattleManager.next_subject
  360.     end
  361.     if Input.trigger?(:B) and (@subject == nil)
  362.       start_party_command_selection
  363.     end
  364.     return unless @subject
  365.     if @subject.current_action
  366.       @subject.current_action.prepare
  367.       if @subject.current_action.valid?
  368.         @status_window.open
  369.         execute_action
  370.       end
  371.       @subject.remove_current_action
  372.       refresh_status
  373.       @log_window.display_auto_affected_status(@subject)
  374.       @log_window.wait_and_clear
  375.     end
  376.     process_action_end unless @subject.current_action
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● Aliases use_item
  380.   #--------------------------------------------------------------------------
  381.   alias cbs_use_item use_item
  382.   def use_item
  383.     cbs_use_item
  384.     @subject.stamina_loss
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● Rewrote turn_end
  388.   #--------------------------------------------------------------------------
  389.   def turn_end
  390.     all_battle_members.each do |battler|
  391.       battler.on_turn_end
  392.       refresh_status
  393.       @log_window.display_auto_affected_status(battler)
  394.       @log_window.wait_and_clear
  395.     end
  396.   end
  397.   #--------------------------------------------------------------------------
  398.   # ● Rewrote command_fight
  399.   #--------------------------------------------------------------------------
  400.   def command_fight
  401.     BattleManager.next_command
  402.     start_actor_command_selection
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● Rewrote command_escape
  406.   #--------------------------------------------------------------------------
  407.   def command_escape
  408.     @party_command_window.close
  409.     BattleManager.set_escaping(true)
  410.     turn_start
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● New method command_pass
  414.   #--------------------------------------------------------------------------
  415.   def command_pass
  416.     BattleManager.actor.stamina -= CBS::PASSING_COST
  417.     BattleManager.clear_actor
  418.     @subject = nil
  419.     turn_start
  420.     @actor_command_window.active = false
  421.     @actor_command_window.close
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● Destroyed next_command
  425.   #--------------------------------------------------------------------------
  426.   def next_command
  427.     # no thank you
  428.   end
  429. end

  430. class Window_BattleStatus < Window_Selectable
  431.   #--------------------------------------------------------------------------
  432.   # ● Rewrote initialize
  433.   #--------------------------------------------------------------------------
  434.   def initialize
  435.     super(0, 48, Graphics.width, window_height) if CBS::ATB
  436.     super(0, 48, Graphics.width - 128, window_height) unless CBS::ATB
  437.     refresh
  438.     self.openness = 0
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● Rewrote window_width
  442.   #--------------------------------------------------------------------------
  443.   def window_width
  444.     Graphics.width - 128
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● Rewrote refresh
  448.   #--------------------------------------------------------------------------
  449.   def refresh
  450.     contents.clear
  451.     draw_all_items
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● Rewrote draw_item
  455.   #--------------------------------------------------------------------------
  456.   def draw_item(index)
  457.     actor = $game_party.battle_members[index]
  458.     draw_basic_area(basic_area_rect(index), actor)
  459.     draw_gauge_area(gauge_area_rect(index), actor)
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ● Rewrote basic_area_rect
  463.   #--------------------------------------------------------------------------
  464.   def basic_area_rect(index)
  465.     rect = item_rect_for_text(index)
  466.     rect.width -= gauge_area_width + 10
  467.     rect
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● Rewrote gauge_area_rect
  471.   #--------------------------------------------------------------------------
  472.   def gauge_area_rect(index)
  473.     rect = item_rect_for_text(index)
  474.     rect.x += rect.width - gauge_area_width #- 128 ####
  475.     rect.width = gauge_area_width
  476.     rect
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● Rewrote gauge_area_width
  480.   #--------------------------------------------------------------------------
  481.   def gauge_area_width
  482.     return 220 + 128 if CBS::ATB
  483.     return 220
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● Rewrote draw_gauge_area_with_tp
  487.   #--------------------------------------------------------------------------
  488.   def draw_gauge_area_with_tp(rect, actor)
  489.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  490.     draw_actor_mp(actor, rect.x + 82, rect.y, 64)
  491.     draw_actor_tp(actor, rect.x + 156, rect.y, 64)
  492.     draw_actor_stamina(actor, rect.x + 240, rect.y, 108) if CBS::ATB
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ● Rewrote draw_gauge_area_without_tp
  496.   #--------------------------------------------------------------------------
  497.   def draw_gauge_area_without_tp(rect, actor)
  498.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  499.     draw_actor_mp(actor, rect.x + 144,  rect.y, 76)
  500.     draw_actor_stamina(actor, rect.x + 240, rect.y, 108) if CBS::ATB
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # ● New Method draw_actor_stamina
  504.   #--------------------------------------------------------------------------
  505.   def draw_actor_stamina(actor, x, y, width = 124)
  506.     draw_gauge(x, y, width, actor.stamina_rate, text_color(CBS.stamina_colors(actor)[2]),text_color(CBS.stamina_colors(actor)[1]))
  507.     change_color(system_color)
  508.     draw_text(x, y, 30, line_height, CBS::SAMINA_GAUGE_NAME)
  509.   end
  510. end

  511. class Window_BattleSkill < Window_SkillList
  512.   #--------------------------------------------------------------------------
  513.   # ● Rewrote initialize
  514.   #--------------------------------------------------------------------------
  515.   def initialize(help_window, info_viewport)
  516.     y = help_window.height
  517.     super(0, y, Graphics.width, info_viewport.rect.y - y + 48)
  518.     self.visible = false
  519.     @help_window = help_window
  520.     @info_viewport = info_viewport
  521.   end
  522. end

  523. class Window_BattleActor < Window_BattleStatus
  524.   #--------------------------------------------------------------------------
  525.   # ● Rewrote initialize
  526.   #--------------------------------------------------------------------------
  527.   def initialize(info_viewport)
  528.     super()
  529.     self.y = info_viewport.rect.y + 48
  530.     self.visible = false
  531.     self.openness = 255
  532.     @info_viewport = info_viewport
  533.   end
  534. end

  535. class Window_BattleEnemy < Window_Selectable
  536.   # ● Rewrote initialize
  537.   #--------------------------------------------------------------------------
  538.   def initialize(info_viewport)
  539.     super(0, info_viewport.rect.y + 48, window_width, fitting_height(4))
  540.     refresh
  541.     self.visible = false
  542.     @info_viewport = info_viewport
  543.   end
  544. end

  545. class Window_BattleItem < Window_ItemList
  546.   #--------------------------------------------------------------------------
  547.   # ● Rewrote initialize
  548.   #--------------------------------------------------------------------------
  549.   def initialize(help_window, info_viewport)
  550.     y = help_window.height
  551.     super(0, y, Graphics.width, info_viewport.rect.y - y + 48)
  552.     self.visible = false
  553.     @help_window = help_window
  554.     @info_viewport = info_viewport
  555.   end
  556. end

  557. module BattleManager
  558.   #--------------------------------------------------------------------------
  559.   # ● Rewrote setup
  560.   #--------------------------------------------------------------------------
  561.   def self.setup(troop_id, can_escape = true, can_lose = false)
  562.     init_members
  563.     $game_troop.setup(troop_id)
  564.     @can_escape = can_escape
  565.     @can_lose = can_lose
  566.     make_escape_ratio
  567.     @escaping = false
  568.     @turn_counter = 0
  569.     @actions_per_turn = $game_party.members.size + $game_troop.members.size
  570.     ($game_party.members + $game_troop.members).each do |battler|
  571.       if battler.is_a?(Game_Enemy) or CBS::RESET_STAMINA
  572.         CBS.stamina_start(battler)
  573.       end
  574.     end
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● New Method set_escaping
  578.   #--------------------------------------------------------------------------
  579.   def self.set_escaping(escaping)
  580.     @escaping = escaping
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● New Method escaping?
  584.   #--------------------------------------------------------------------------
  585.   def self.escaping?
  586.     return @escaping
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● Rewrote turn_start
  590.   #--------------------------------------------------------------------------
  591.   def self.turn_start
  592.     @phase = :turn
  593.     clear_actor
  594.     $game_troop.increase_turn if $game_troop.turn_count == 0
  595.   end
  596.   #--------------------------------------------------------------------------
  597.   # ● New Method set_actor
  598.   #--------------------------------------------------------------------------
  599.   def self.set_actor(actor)
  600.     @actor_index = actor.index
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● New Increase action counter
  604.   #--------------------------------------------------------------------------
  605.   def self.add_action
  606.     return if @actions_per_turn.nil?
  607.     @turn_counter += 1
  608.     if @turn_counter == @actions_per_turn and CBS::TURN_LENGTH == 0
  609.       $game_troop.increase_turn
  610.       SceneManager.scene.turn_end
  611.       @turn_counter = 0
  612.     end
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● New Method advance_turn
  616.   #--------------------------------------------------------------------------
  617.   def self.advance_turn
  618.     return if CBS::TURN_LENGTH == 0
  619.     @turn_counter += 1
  620.     if @turn_counter == 60 * CBS::TURN_LENGTH
  621.       $game_troop.increase_turn
  622.       SceneManager.scene.turn_end
  623.       @turn_counter = 0
  624.     end
  625.   end
  626. end

  627. class Game_Battler < Game_BattlerBase
  628.   #--------------------------------------------------------------------------
  629.   # ● Rewrote on_turn_end
  630.   #--------------------------------------------------------------------------
  631.   def on_turn_end
  632.     @result.clear
  633.     regenerate_all
  634.     update_state_turns
  635.     update_buff_turns
  636.     remove_states_auto(2)
  637.   end
  638.   #--------------------------------------------------------------------------
  639.   # ● New Method on_turn_end
  640.   #--------------------------------------------------------------------------
  641.   def stamina_loss
  642.     if self.actor?
  643.       @stamina -= input.stamina_cost
  644.     else
  645.       @stamina -= @actions[0].stamina_cost
  646.     end
  647.     BattleManager.add_action
  648.   end
  649. end

  650. class Game_Actor < Game_Battler
  651.   #--------------------------------------------------------------------------
  652.   # ● Rewrote input
  653.   #--------------------------------------------------------------------------
  654.   def input
  655.     if @actions[@action_input_index] == nil
  656.       @actions[@action_input_index] = Game_Action.new(self)
  657.     end
  658.     return @actions[@action_input_index]
  659.   end
  660. end

  661. class Game_Action
  662.   #--------------------------------------------------------------------------
  663.   # ● New Method stamina_cost
  664.   #--------------------------------------------------------------------------
  665.   def stamina_cost
  666.     if @item.is_skill?
  667.       return CBS::SKILL_COST[item.id] if CBS::SKILL_COST[item.id]
  668.       return CBS::SKILL_COST[0]
  669.     end
  670.     return CBS::ITEM_COST if @item.is_item?
  671.     return CBS::MAX_STAMINA
  672.   end
  673. end
复制代码
等一回我研究好了再来发说明。
好了,研究成功。
把ATB = true改为false则系统会变成CTB。不要告诉我你不知道CTB是什么。
如果ATB = true,则是ATB。也不要告诉我你不知道ATB是什么。
一定要把防御的回合数调整为2!
所有改变AGI的状态都必须在脚本里面体现!

评分

参与人数 1星屑 +40 收起 理由
无双sxa + 40 很好。

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
154
在线时间
664 小时
注册时间
2011-9-25
帖子
241
4
发表于 2012-3-16 11:02:01 | 只看该作者
横版的吗?

点评

不是  发表于 2012-3-16 11:05
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
154
在线时间
664 小时
注册时间
2011-9-25
帖子
241
5
发表于 2012-3-16 11:07:05 | 只看该作者
类似仙剑3的?

点评

另外无法复合仙术,比如说我用了10次冰咒,学会雨润。再用20次冰咒,学会烟水了,即便我一次雨润也没用。明白了么?  发表于 2012-3-16 11:16
显然,一方面我们的这个系统没有技能书 另一方面只能出新招,不能加大旧招威力  发表于 2012-3-16 11:13
不是。这个比较不完善,仙术无法升级。而仙剑三是通过书学习,然后使用升级  发表于 2012-3-16 11:12
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
6
 楼主| 发表于 2012-3-16 11:07:10 | 只看该作者

【3级转载】奇怪的装备升级系统

本帖最后由 杂兵天下 于 2012-3-16 15:08 编辑

来源http://cobbtocs.co.uk/wp/
  1. =begin
  2. AP System Script II
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  9. Implements an ap system for you to use when creating skill
  10. systems that utilise AP.
  11. ----------------------
  12. Instructions
  13. ----------------------
  14. Notetag <ap x> e.g. <ap 4> <ap 100>
  15. ----------------------
  16. Known bugs
  17. ----------------------
  18. None
  19. =end
  20. module Vocab
  21.   ObtainAp         = "%s AP was obtained!"
  22. end

  23. class Game_Actor < Game_Battler
  24.   #--------------------------------------------------------------------------
  25.   # ● New Method gain_ap
  26.   #--------------------------------------------------------------------------
  27.   def gain_ap(ap)
  28.     # your code goes here
  29.   end
  30. end

  31. module BattleManager
  32.   #--------------------------------------------------------------------------
  33.   # ● Rewrote self.display_exp
  34.   #--------------------------------------------------------------------------
  35.   def self.display_exp
  36.     if $game_troop.exp_total > 0
  37.       text = sprintf(Vocab::ObtainExp, $game_troop.exp_total)
  38.       $game_message.add('\.' + text)
  39.     end
  40.     if $game_troop.ap_total > 0
  41.       text = sprintf(Vocab::ObtainAp, $game_troop.ap_total)
  42.       $game_message.add('\.' + text)
  43.     end
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● Rewrote self.gain_exp
  47.   #--------------------------------------------------------------------------
  48.   def self.gain_exp
  49.     $game_party.all_members.each do |actor|
  50.         actor.gain_exp($game_troop.exp_total)
  51.     end
  52.     wait_for_message
  53.     $game_party.all_members.each do |actor|
  54.     actor.gain_ap($game_troop.ap_total)
  55.     end
  56.     wait_for_message
  57.   end
  58. end

  59. class Game_Troop < Game_Unit
  60.   #--------------------------------------------------------------------------
  61.   # ● New Method ap_total
  62.   #--------------------------------------------------------------------------
  63.   def ap_total
  64.     dead_members.inject(0) {|r, enemy| r += enemy.ap }
  65.   end
  66. end

  67. class Game_Enemy < Game_Battler
  68.   #--------------------------------------------------------------------------
  69.   # ● New Method ap_total
  70.   #--------------------------------------------------------------------------
  71.   def ap
  72.     if enemy.note =~ /<ap (.*)>/i
  73.       return $1.to_i
  74.     else
  75.       return 0
  76.     end
  77.   end
  78. end
  79. =begin
  80. Individual Equipment
  81. by Fomar0153
  82. Version 1.1
  83. ----------------------
  84. Notes
  85. ----------------------
  86. This script changes the way weapons and armours are handled
  87. in game. This script make every weapon and armour unique.
  88. ----------------------
  89. Instructions
  90. ----------------------
  91. Plug and play.
  92. If you want to be able to carry more than 150 weapons and 150 armors
  93. edit MAX_INVENTORY_SIZE which you can find at the top of the script.
  94. This script is designed to be a base for other scripts.
  95. For example:
  96. Proper Weapon and Armour Customisation.
  97. ----------------------
  98. Change Log
  99. ----------------------
  100. 1.0 -> 1.1 Added a single character (@) to fix a bug where you
  101.            created new equipment when changing equipment.
  102. ----------------------
  103. Known bugs
  104. ----------------------
  105. None
  106. =end

  107. module CustomEquip
  108.   
  109.   MAX_INVENTORY_SIZE = 150
  110.   
  111. end

  112. class Game_CustomEquip < Game_BaseItem
  113.   #--------------------------------------------------------------------------
  114.   # ● New attr_accessor & attr_reader
  115.   #--------------------------------------------------------------------------
  116.   attr_accessor :pos
  117.   attr_reader   :item_id
  118.   #--------------------------------------------------------------------------
  119.   # ● Pos is used to identify weapons and armors
  120.   #--------------------------------------------------------------------------
  121.   def initialize
  122.     super
  123.     @pos = 0
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● The rest of the methods allow this item to pretend to be RPG::Weapon
  127.   #   and RPG::Armor in some cases, increasing compatability, thought not
  128.   #   as much as I would like.
  129.   #--------------------------------------------------------------------------
  130.   def description
  131.     return nil if is_nil?
  132.     return object.description
  133.   end
  134.   
  135.   def name
  136.     return nil if is_nil?
  137.     return object.name
  138.   end
  139.   
  140.   def icon_index
  141.     return nil if is_nil?
  142.     return object.icon_index
  143.   end
  144.   
  145.   def price
  146.     return nil if is_nil?
  147.     return object.price
  148.   end
  149.   
  150.   def animation_id
  151.     return nil if is_nil?
  152.     return nil if is_armor? # variable only exists for RPG::Weapon
  153.     return object.animation_id
  154.   end
  155.   
  156.   def note
  157.     return nil if is_nil?
  158.     return object.note
  159.   end
  160.   
  161.   def id
  162.     return nil if is_nil?
  163.     return object.id
  164.   end
  165.   
  166.   def features
  167.     return nil if is_nil?
  168.     return object.features
  169.   end
  170.   
  171.   def params
  172.     return nil if is_nil?
  173.     return object.params
  174.   end
  175.   
  176.   def etype_id
  177.     return nil if is_nil?
  178.     return object.etype_id
  179.   end
  180.   
  181.   def wtype_id
  182.     return nil if is_nil?
  183.     return nil if is_armor? # variable only exists for RPG::Weapon
  184.     return object.wtype_id
  185.   end
  186.   
  187.   def atype_id
  188.     return nil if is_nil?
  189.     return nil if is_weapon? # variable only exists for RPG::Armor
  190.     return object.atype_id
  191.   end
  192.   
  193.   
  194.   # performance returns an integer calculated from the equip item's params.
  195.   # each point in a param increasing performance by one, except
  196.   # for attack and magic on weapon which counts double
  197.   # for defence and magic defence on armours which counts double
  198.   def performance
  199.     return nil if is_nil?
  200.     return object.performance
  201.   end
  202.   
  203. end

  204. class Game_Party < Game_Unit
  205.   #--------------------------------------------------------------------------
  206.   # ● Aliases init_all_items
  207.   #--------------------------------------------------------------------------
  208.   alias ie_init_all_items init_all_items
  209.   def init_all_items
  210.     ie_init_all_items
  211.     @weapons = []
  212.     @armors = []
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ● Rewrites weapons
  216.   #--------------------------------------------------------------------------
  217.   def weapons
  218.     return @weapons
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● Rewrites armors
  222.   #--------------------------------------------------------------------------
  223.   def armors
  224.     return @armors
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● Aliases item_number + Probably rewrite
  228.   #--------------------------------------------------------------------------
  229.   alias ie_item_number item_number
  230.   def item_number(item)
  231.     if item.class == RPG::Weapon or item.class == RPG::Armor
  232.       return 1 # I haven't found this to cause unexpected behaviour
  233.                # but I don't like it
  234.     else
  235.       return ie_item_number(item)
  236.     end
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● Aliases gain_item
  240.   #--------------------------------------------------------------------------
  241.   alias ie_gain_item gain_item
  242.   def gain_item(item, amount, include_equip = false)
  243.     if item.class == RPG::Weapon
  244.       if amount > 0
  245.         for i in 1..amount
  246.           t = Game_CustomEquip.new
  247.           t.object = item
  248.           @weapons.push(t)
  249.         end
  250.         weapon_sort
  251.       end
  252.     elsif item.is_a?(Game_CustomEquip) && item.is_weapon?
  253.       if amount == 1
  254.         @weapons.push(item)
  255.         weapon_sort
  256.       elsif amount == -1
  257.         # Can't sell more than 1 at a time
  258.         # (is there any other way to remove more than 1 at a time?
  259.         # except through events?)
  260.         @weapons.delete_at(item.pos)
  261.         weapon_sort
  262.       end
  263.     elsif item.class == RPG::Armor
  264.       if amount > 0
  265.         for i in 1..amount
  266.           t = Game_CustomEquip.new
  267.           t.object = item
  268.           @armors.push(t)
  269.         end
  270.         armor_sort
  271.       end
  272.     elsif item.is_a?(Game_CustomEquip) && item.is_armor?
  273.       if amount == 1
  274.         @armors.push(item)
  275.         armor_sort
  276.       elsif amount == -1
  277.         # Can't sell more than 1 at a time
  278.         # (is there any other way to remove more than 1 at a time?
  279.         # except through events?)
  280.         @armors.delete_at(item.pos)
  281.         armor_sort
  282.       end
  283.     else
  284.       ie_gain_item(item, amount, include_equip)
  285.       return
  286.     end
  287.     $game_map.need_refresh = true
  288.   end
  289.   
  290.   def weapon_sort
  291.     @weapons.sort! { |a, b|  a.item_id <=> b.item_id }
  292.     for i in [email protected] - 1
  293.       @weapons[i].pos = i
  294.     end
  295.   end
  296.   
  297.   def armor_sort
  298.     @armors.sort! { |a, b|  a.item_id <=> b.item_id }
  299.     for i in [email protected] - 1
  300.       @armors[i].pos = i
  301.     end
  302.   end
  303.   
  304.   alias ie_max_item_number max_item_number
  305.   def max_item_number(item)
  306.     if item.class == RPG::Weapon
  307.       return CustomEquip::MAX_INVENTORY_SIZE - @weapons.size
  308.     elsif item.class == RPG::Armor
  309.       return CustomEquip::MAX_INVENTORY_SIZE - @armors.size
  310.     else
  311.       return ie_max_item_number(item)
  312.     end
  313.   end
  314. end

  315. class Window_ItemList < Window_Selectable
  316.   
  317.   alias ie_include? include?
  318.   def include?(item)
  319.     case @category
  320.     when :weapon
  321.       item.is_a?(Game_CustomEquip) && item.object.is_a?(RPG::Weapon)
  322.     when :armor
  323.       item.is_a?(Game_CustomEquip) && item.object.is_a?(RPG::Armor)
  324.     else
  325.       ie_include?(item)
  326.     end
  327.   end
  328.   
  329.   alias ie_draw_item draw_item
  330.   def draw_item(index)
  331.     item = @data[index]
  332.     if item && !item.is_a?(Game_CustomEquip)
  333.       ie_draw_item(index)
  334.     elsif item && item.is_a?(Game_CustomEquip)
  335.       rect = item_rect(index)
  336.       rect.width -= 4
  337.       draw_item_name(item, rect.x, rect.y, enable?(item))
  338.       #draw_item_number(rect, item) just this line removed from the default
  339.     end
  340.   end
  341.   
  342. end


  343. class Window_EquipItem < Window_ItemList
  344.   #--------------------------------------------------------------------------
  345.   # ● Aliases include?
  346.   #--------------------------------------------------------------------------
  347.   alias ie2_include? include?
  348.   def include?(item)
  349.     return true if item == nil
  350.     return false unless item.is_a?(Game_CustomEquip)
  351.     return ie2_include?(item.object)
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ● Rewrites update_help
  355.   #--------------------------------------------------------------------------
  356.   def update_help
  357.     super
  358.     if @actor && @status_window
  359.       temp_actor = Marshal.load(Marshal.dump(@actor))
  360.       temp_actor.force_change_equip(@slot_id, item) unless item.nil?
  361.       @status_window.set_temp_actor(temp_actor)
  362.     end
  363.   end
  364. end


  365. class Game_Actor < Game_Battler
  366.   #--------------------------------------------------------------------------
  367.   # ● Rewrites init_equips
  368.   #--------------------------------------------------------------------------
  369.   def init_equips(equips)
  370.     @equips = Array.new(equip_slots.size) { Game_CustomEquip.new } # only change
  371.     equips.each_with_index do |item_id, i|
  372.       etype_id = index_to_etype_id(i)
  373.       slot_id = empty_slot(etype_id)
  374.       @equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
  375.     end
  376.     refresh
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● Rewrites change_equip
  380.   #--------------------------------------------------------------------------
  381.   def change_equip(slot_id, item)
  382.     return unless trade_item_with_party(item, @equips[slot_id])
  383.     return if item && equip_slots[slot_id] != item.etype_id
  384.     if item.nil?
  385.       @equips[slot_id] = Game_CustomEquip.new
  386.     else
  387.       @equips[slot_id] = item
  388.     end
  389.     refresh
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # ● Rewrites force_change_equip
  393.   #--------------------------------------------------------------------------
  394.   def force_change_equip(slot_id, item)
  395.     if item.nil?
  396.       @equips[slot_id] = Game_CustomEquip.new
  397.     else
  398.       @equips[slot_id] = item
  399.     end
  400.     release_unequippable_items(false)
  401.     refresh
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● Rewrites trade_item_with_party
  405.   #--------------------------------------------------------------------------
  406.   def trade_item_with_party(new_item, old_item)
  407.     #return false if new_item && !$game_party.has_item?(new_item) removed
  408.     $game_party.gain_item(old_item, 1)
  409.     $game_party.lose_item(new_item, 1)
  410.     return true
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● Rewrites change_equip_by_id
  414.   #--------------------------------------------------------------------------
  415.   def change_equip_by_id(slot_id, item_id)
  416.     if equip_slots[slot_id] == 0
  417.       t = Game_CustomEquip.new
  418.       t.object = $data_weapons[item_id]
  419.       $game_party.gain_item(t, 1)
  420.       change_equip(slot_id, t)
  421.     else
  422.       t = Game_CustomEquip.new
  423.       t.object = $data_armors[item_id]
  424.       $game_party.gain_item(t, 1)
  425.       change_equip(slot_id, t)
  426.     end
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● Rewrites optimize_equipments or does it
  430.   #--------------------------------------------------------------------------
  431.   def optimize_equipments
  432.     clear_equipments
  433.     equip_slots.size.times do |i|
  434.       next if !equip_change_ok?(i)
  435.       items = $game_party.equip_items.select do |item|
  436.         item.etype_id == equip_slots[i] &&
  437.         equippable?(item.object) && item.performance >= 0
  438.       end
  439.       change_equip(i, items.max_by {|item| item.performance })
  440.     end
  441.   end
  442. end


  443. class Window_ShopStatus < Window_Base
  444.   
  445.   alias ie_draw_possession draw_possession
  446.   def draw_possession(x, y)
  447.     return if @item.is_a?(RPG::EquipItem)
  448.     ie_draw_possession(x, y)
  449.   end
  450.   
  451.   alias ie_draw_equip_info draw_equip_info
  452.   def draw_equip_info(x, y)
  453.     ie_draw_equip_info(x, y - line_height * 2)
  454.   end
  455. end
  456. =begin
  457. Equipment Levels Up
  458. by Fomar0153
  459. Version 1.0
  460. ----------------------
  461. Notes
  462. ----------------------
  463. This script allows weapons to grow stronger and level up when they
  464. gain exp or ap.
  465. ----------------------
  466. Instructions
  467. ----------------------
  468. Requires my individual equipment script. (Make sure it is version 1.1+)
  469. Requires an AP script if leveling weapons using AP.
  470. Customise the variables in the module below to set up the script to your
  471. liking.

  472. Notetags
  473. <maxlevel x> - adds a non-default max level to the tagged equipment.
  474. ----------------------
  475. Known bugs
  476. ----------------------
  477. None
  478. =end

  479. module Fomar
  480.   
  481.   # If you only want to implement this for weapons or armours set
  482.   # the following to false as you see fit
  483.   WLU_WEAPONS_LEVEL_UP = true
  484.   WLU_ARMOURS_LEVEL_UP = true
  485.   # This script can be set up to use either EXP or AP
  486.   # For AP you will also need an AP system.
  487.   # true -> uses AP
  488.   # false -> uses EXP
  489.   WLU_USE_AP = true
  490.   # Determines the order of the substitutions
  491.   # true -> level, name
  492.   # false -> name, level
  493.   WLU_PREFIX = true
  494.   # the %s are replaced by the level and name of the weapon
  495.   WLU_VOCAB_WEAPON_NAME = "%s级%s"
  496.   # Default max level
  497.   # set to 0 to only allow chosen weapons to level up
  498.   WLU_DEF_MAX_LEVEL = 5
  499.   # Default stat increase per level (percentage)
  500.   WLU_DEF_PARAM_INC = 25
  501.   # Set to false if you want the price of the item to be unaffected
  502.   # by leveling up
  503.   WLU_PRICE_LEVEL_UP = true
  504.   # Default experience per level
  505.   # I have provided two defaults, one designed for EXP and one for AP
  506.   def self.WLU_EXP_FOR_LEVEL(item); return item.performance * 10; end
  507.   def self.WLU_AP_FOR_LEVEL(item); return item.performance; end
  508.   
  509. end


  510. class Game_CustomEquip < Game_BaseItem
  511.   
  512.   alias wlu_initialize initialize
  513.   def initialize
  514.     wlu_initialize
  515.     @exp = 0
  516.     @level = 1
  517.   end
  518.   
  519.   def gain_exp(exp)
  520.     return unless levels?
  521.     @exp += exp
  522.     last_level = @level
  523.     unless Fomar::WLU_USE_AP
  524.       while @exp >= @level * Fomar.WLU_EXP_FOR_LEVEL(object) and @level < object.max_level
  525.         @level += 1
  526.         $game_message.add(object.name + " levels up.")
  527.       end
  528.     else
  529.       while @exp >= @level * Fomar.WLU_AP_FOR_LEVEL(object) and @level < object.max_level
  530.         @level += 1
  531.         $game_message.add(object.name + " levels up.")
  532.       end
  533.     end
  534.   end
  535.   
  536.   def levels?
  537.     return false if is_nil?
  538.     return (((is_weapon? and Fomar::WLU_WEAPONS_LEVEL_UP) or
  539.             (is_armor? and Fomar::WLU_ARMOURS_LEVEL_UP)) and
  540.             object.max_level > 0)
  541.   end
  542.   
  543.   alias wlu_name name
  544.   def name
  545.     return nil if is_nil?
  546.     return wlu_name unless levels?
  547.     return sprintf(Fomar::WLU_VOCAB_WEAPON_NAME,@level,wlu_name) if Fomar::WLU_PREFIX
  548.     return sprintf(Fomar::WLU_VOCAB_WEAPON_NAME,wlu_name,@level)
  549.   end
  550.   
  551.   alias wlu_price price
  552.   def price
  553.     return nil if is_nil?
  554.     return wlu_price unless levels?
  555.     return wlu_price unless Fomar::WLU_PRICE_LEVEL_UP
  556.     return (100 + Fomar::WLU_DEF_PARAM_INC * @level + object.price)/100
  557.   end
  558.   
  559.   def params
  560.     return nil if is_nil?
  561.     par = object.params.clone
  562.     for i in 0..par.size - 1
  563.       par[i] *= 100 + Fomar::WLU_DEF_PARAM_INC * (@level - 1)
  564.       par[i] /= 100
  565.     end
  566.     return par
  567.   end
  568.   
  569.   alias wlu_performance performance
  570.   def performance
  571.     return nil if is_nil?
  572.     return wlu_performance unless levels?
  573.     par = params
  574.     p = 0
  575.     for pa in par
  576.       p += pa
  577.     end
  578.     if is_weapon?
  579.       p += par[2] + par[4]
  580.     else
  581.       p += par[3] + par[5]
  582.     end
  583.     return p
  584.   end
  585.   
  586. end

  587. module RPG
  588.   class EquipItem
  589.     def max_level
  590.       if self.note =~ /<maxlevel (.*)>/i
  591.         return $1.to_i
  592.       else
  593.         return Fomar::WLU_DEF_MAX_LEVEL
  594.       end
  595.     end
  596.   end
  597. end

  598. class Game_Actor < Game_Battler
  599.   
  600.   alias wlu_gain_exp gain_exp
  601.   def gain_exp(exp)
  602.     for equip in @equips
  603.       equip.gain_exp(exp)
  604.     end
  605.     wlu_gain_exp(exp)
  606.   end
  607.   
  608.   def gain_ap(ap)
  609.     for equip in @equips
  610.       equip.gain_exp(ap)
  611.     end
  612.   end
  613.   
  614.   def custom_equips
  615.     return @equips
  616.   end
  617.   
  618.   # rewrites param_plus
  619.   def param_plus(param_id)
  620.     p = super(param_id)
  621.     for equip in @equips
  622.       p += equip.params[param_id] unless equip.is_nil?
  623.     end
  624.     return p
  625.   end
  626.   
  627. end


  628. class Window_Base < Window
  629.   
  630.   alias wlu_draw_item_name draw_item_name
  631.   def draw_item_name(item, x, y, enabled = true, width = 172)
  632.     return unless item
  633.     if item.is_a?(Game_CustomEquip)
  634.       return if item.is_nil?
  635.     end
  636.     wlu_draw_item_name(item, x, y, enabled = true, width)
  637.   end
  638.   
  639. end

  640. class Window_EquipSlot < Window_Selectable
  641.   
  642.   # rewrites draw_item
  643.   def draw_item(index)
  644.     return unless @actor
  645.     rect = item_rect_for_text(index)
  646.     change_color(system_color, enable?(index))
  647.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  648.     draw_item_name(@actor.custom_equips[index], rect.x + 92, rect.y, enable?(index))
  649.   end
  650.   
  651. end
  652. =begin
  653. Equipment Skills System Script
  654. by Fomar0153
  655. Version 1.1
  656. ----------------------
  657. Notes
  658. ----------------------
  659. Requires an AP System if you want characters to
  660. learn skills pernamently.
  661. If using my Custom Equipment Slots script then
  662. make sure this script is above the Equipment Slots Script
  663. and make sure you have the compatability patch.
  664. Allows learning of skills by equipment with the
  665. option to learn skills pernamently.
  666. ----------------------
  667. Instructions
  668. ----------------------
  669. Set Learn_Skills to false if you want the skills to
  670. only be temporary.
  671. If you can learn skills then you need to set up AP for
  672. each skill you put on an item.
  673. In the notes section put:
  674. AP:n
  675. where n is the ap required to learn pernamently.
  676. Then follow the instructions below about how to add skills
  677. to weapons and armor.
  678. ----------------------
  679. Change Log
  680. ----------------------
  681. 1.0 -> 1.1 Fixed a bug which caused skills learnt from
  682.            armour to not display they were learnt.
  683. ----------------------
  684. Known bugs
  685. ----------------------
  686. None
  687. =end


  688. module Equipment_Skills

  689.   # If set to false then characters will not
  690.   # learn the skills pernamently and you will
  691.   # not need an ap system
  692.   Learn_Skills = true

  693.   Weapons = []
  694.   # Add weapon skills in this format
  695.   # Weapons[weapon_id] = [skillid1, skillid2]
  696.   Weapons[1] = [8]

  697.   Armors = []
  698.   # Add weapon skills in this format
  699.   # Armors[armor_id] = [skillid1, skillid2]
  700.   Armors[3] = [9]

  701.   def self.get_ap_cost(skill_id)
  702.     t = $data_skills[skill_id].note
  703.     if t.include?("AP:")
  704.       ap = /AP:(\d+)/.match(t)
  705.       ap = ap[0].split(":")
  706.       return ap[1].to_i
  707.     end
  708.     return 999
  709.   end

  710. end

  711. class Game_Actor < Game_Battler
  712.   attr_reader   :ap
  713.   #--------------------------------------------------------------------------
  714.   # ● Aliases setup
  715.   #--------------------------------------------------------------------------
  716.   alias eqskills_setup setup
  717.   def setup(actor_id)
  718.     eqskills_setup(actor_id)
  719.     if Equipment_Skills::Learn_Skills
  720.       @ap = []
  721.     end
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # ● Rewrites change_equip
  725.   #--------------------------------------------------------------------------
  726.   def change_equip(slot_id, item)
  727.     return unless trade_item_with_party(item, equips[slot_id])
  728.     if equips[slot_id].is_a?(RPG::Weapon)
  729.       unless Equipment_Skills::Weapons[equips[slot_id].id] == nil
  730.         for skill in Equipment_Skills::Weapons[equips[slot_id].id]
  731.           if Equipment_Skills::Learn_Skills
  732.             if @ap[skill] == nil
  733.               @ap[skill] = 0
  734.             end
  735.             unless @ap[skill] >= Equipment_Skills.get_ap_cost(skill)
  736.               forget_skill(skill)
  737.             end
  738.           else
  739.             forget_skill(skill)
  740.           end
  741.         end
  742.       end
  743.     end
  744.     if equips[slot_id].is_a?(RPG::Armor)
  745.       unless Equipment_Skills::Armors[equips[slot_id].id] == nil
  746.         for skill in Equipment_Skills::Armors[equips[slot_id].id]
  747.           if Equipment_Skills::Learn_Skills
  748.             if @ap[skill] == nil
  749.               @ap[skill] = 0
  750.             end
  751.             unless @ap[skill] >= Equipment_Skills.get_ap_cost(skill)
  752.               forget_skill(skill)
  753.             end
  754.           else
  755.             forget_skill(skill)
  756.           end
  757.         end
  758.       end
  759.     end
  760.     return if item && equip_slots[slot_id] != item.etype_id
  761.     @equips[slot_id].object = item
  762.     refresh
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● New Method or Rewrites gain_ap
  766.   #--------------------------------------------------------------------------
  767.   def gain_ap(ap)
  768.     if Equipment_Skills::Learn_Skills
  769.       for item in self.equips
  770.         if item.is_a?(RPG::Weapon)
  771.           unless Equipment_Skills::Weapons[item.id] == nil
  772.             for skill in Equipment_Skills::Weapons[item.id]
  773.               if @ap[skill] == nil
  774.                 @ap[skill] = 0
  775.               end
  776.               last_ap = @ap[skill]
  777.               @ap[skill] += ap
  778.               if last_ap < Equipment_Skills.get_ap_cost(skill) and Equipment_Skills.get_ap_cost(skill) <= @ap[skill]
  779.                 SceneManager.scene.add_message(actor.name + " learns " + $data_skills[skill].name + ".")
  780.               end
  781.             end
  782.           end
  783.         end
  784.         if item.is_a?(RPG::Armor)
  785.           unless Equipment_Skills::Armors[item.id] == nil
  786.             for skill in Equipment_Skills::Armors[item.id]
  787.               if @ap[skill] == nil
  788.                 @ap[skill] = 0
  789.               end
  790.               last_ap = @ap[skill]
  791.               @ap[skill] += ap
  792.               if last_ap < Equipment_Skills.get_ap_cost(skill) and Equipment_Skills.get_ap_cost(skill) <= @ap[skill]
  793.                 SceneManager.scene.add_message(actor.name + " learns " + $data_skills[skill].name + ".")
  794.               end
  795.             end
  796.           end
  797.         end
  798.       end
  799.     end
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # ● Aliases refresh
  803.   #--------------------------------------------------------------------------
  804.   alias eqskills_refresh refresh
  805.   def refresh
  806.     eqskills_refresh
  807.     for item in self.equips
  808.       if item.is_a?(RPG::Weapon)
  809.         unless Equipment_Skills::Weapons[item.id] == nil
  810.           for skill in Equipment_Skills::Weapons[item.id]
  811.             learn_skill(skill)
  812.           end
  813.         end
  814.       end
  815.       if item.is_a?(RPG::Armor)
  816.         unless Equipment_Skills::Armors[item.id] == nil
  817.           for skill in Equipment_Skills::Armors[item.id]
  818.             learn_skill(skill)
  819.           end
  820.         end
  821.       end
  822.     end
  823.     # relearn any class skills you may have forgotten
  824.     self.class.learnings.each do |learning|
  825.       learn_skill(learning.skill_id) if learning.level <= @level
  826.     end
  827.   end
  828. end


  829. class Window_EquipItem < Window_ItemList
  830.   #--------------------------------------------------------------------------
  831.   # ● Rewrites col_max
  832.   #--------------------------------------------------------------------------
  833.   def col_max
  834.     return 1
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ● Aliases update_help
  838.   #--------------------------------------------------------------------------
  839.   alias eqskills_update_help update_help
  840.   def update_help
  841.     eqskills_update_help
  842.     if @actor && @status_window
  843.       @status_window.refresh(item)
  844.     end
  845.   end
  846. end

  847. class Scene_Equip < Scene_MenuBase
  848.   #--------------------------------------------------------------------------
  849.   # ● Rewrites create_item_window
  850.   #--------------------------------------------------------------------------
  851.   alias eqskills_create_item_window create_item_window
  852.   def create_item_window
  853.     wx = @status_window.width # Edited line if you need to merge
  854.     wy = @slot_window.y + @slot_window.height
  855.     ww = @slot_window.width  # Edited line if you need to merge
  856.     wh = Graphics.height - wy
  857.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  858.     @item_window.viewport = @viewport
  859.     @item_window.help_window = @help_window
  860.     @item_window.status_window = @status_window
  861.     @item_window.actor = @actor
  862.     @item_window.set_handler(:ok,    method(:on_item_ok))
  863.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  864.     @slot_window.item_window = @item_window
  865.   end
  866. end


  867. class Window_EquipStatus < Window_Base
  868.   #--------------------------------------------------------------------------
  869.   # ● Rewrites window_height
  870.   #--------------------------------------------------------------------------
  871.   def window_height
  872.     Graphics.height - (2 * line_height + standard_padding * 2)#fitting_height(visible_line_number)
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # ● Aliases refresh
  876.   #--------------------------------------------------------------------------
  877.   alias eqskills_refresh refresh
  878.   def refresh(item = nil)
  879.     eqskills_refresh
  880.     contents.clear
  881.     draw_actor_name(@actor, 4, 0) if @actor
  882.     6.times {|i| draw_item(0, line_height * (1 + i), 2 + i) }
  883.       unless item == nil
  884.       if item.is_a?(RPG::Weapon)
  885.         unless Equipment_Skills::Weapons[item.id] == nil
  886.           skills = Equipment_Skills::Weapons[item.id]
  887.         end
  888.       end
  889.       if item.is_a?(RPG::Armor)
  890.         unless Equipment_Skills::Armors[item.id] == nil
  891.           skills = Equipment_Skills::Armors[item.id]
  892.         end
  893.       end
  894.       unless skills == nil
  895.         change_color(normal_color)
  896.         draw_text(4, 168, width, line_height, "Equipment Skills")
  897.         change_color(system_color)
  898.         i = 1
  899.         for skill in skills
  900.           draw_text(4, 168 + 24 * i, width, line_height, $data_skills[skill].name)
  901.           if Equipment_Skills::Learn_Skills and @actor.ap[skill] == nil
  902.             @actor.ap[skill] = 0
  903.           end
  904.           i = i + 1
  905.           if Equipment_Skills::Learn_Skills
  906.             draw_current_and_max_values(4, 168 + 24 * i, width - 50, [@actor.ap[skill],Equipment_Skills.get_ap_cost(skill)].min, Equipment_Skills.get_ap_cost(skill), system_color, system_color)
  907.             i = i + 1
  908.           end
  909.         end
  910.       end
  911.     end
  912.   end
  913. end


  914. class Window_EquipSlot < Window_Selectable
  915.   #--------------------------------------------------------------------------
  916.   # ● Aliases update
  917.   #--------------------------------------------------------------------------
  918.   alias eqskills_update update
  919.   def update
  920.     eqskills_update
  921.     @status_window.refresh(self.item) if self.active == true
  922.   end
  923. end


  924. class Scene_Battle < Scene_Base
  925.   #--------------------------------------------------------------------------
  926.   # ● New method add_text
  927.   #--------------------------------------------------------------------------
  928.   def add_message(text)
  929.     $game_message.add('\.' + text)
  930.   end
  931. end
  932. =begin
  933. Equipment Skills by Level
  934. by Fomar0153
  935. Version 1.0
  936. ----------------------
  937. Notes
  938. ----------------------
  939. Requires an AP System if you want characters to
  940. learn skills pernamently.
  941. Scripts should be in this order
  942. Individual Equipment
  943. Equipment Levels Up
  944. Equipment Skills
  945. Equipment Skills by Level
  946. If using an AP script it should be above this script.
  947. ----------------------
  948. Instructions
  949. ----------------------
  950. Follow the instructions in all the other script and then
  951. edit the Equipment_Skills module below to suit your needs.
  952. ----------------------
  953. Known bugs
  954. ----------------------
  955. None
  956. =end
  957. module Equipment_Skills

  958.   Weapons = []
  959.   # Add weapon skills in this format
  960.   # Weapons[weapon_id, level] = [[level,skillid], [level,skillid]]
  961.   Weapons[1] = [[1,8],[5,9]]
  962.   
  963.   Armors = []
  964.   # Add weapon skills in this format
  965.   # Armors[armor_id, level] = [[level,skillid],[level,skillid]]
  966.   Armors[1] = [[1,10]]

  967. end

  968. class Game_Actor
  969.   
  970.   def change_equip(slot_id, item)
  971.     return unless trade_item_with_party(item, equips[slot_id])
  972.     if equips[slot_id].is_a?(RPG::Weapon)
  973.       unless Equipment_Skills::Weapons[equips[slot_id].id] == nil
  974.         for skill in Equipment_Skills::Weapons[equips[slot_id].id]
  975.           if Equipment_Skills::Learn_Skills
  976.             if @ap[skill[1]] == nil
  977.               @ap[skill[1]] = 0
  978.             end
  979.             unless @ap[skill[1]] >= Equipment_Skills.get_ap_cost(skill[1])
  980.               forget_skill(skill[1])
  981.             end
  982.           else
  983.             forget_skill(skill[1])
  984.           end
  985.         end
  986.       end
  987.     end
  988.     if equips[slot_id].is_a?(RPG::Armor)
  989.       unless Equipment_Skills::Armors[equips[slot_id].id] == nil
  990.         for skill in Equipment_Skills::Armors[equips[slot_id].id]
  991.           if Equipment_Skills::Learn_Skills
  992.             if @ap[skill[1]] == nil
  993.               @ap[skill[1]] = 0
  994.             end
  995.             unless @ap[skill[1]] >= Equipment_Skills.get_ap_cost(skill[1])
  996.               forget_skill(skill[1])
  997.             end
  998.           else
  999.             forget_skill(skill[1])
  1000.           end
  1001.         end
  1002.       end
  1003.     end
  1004.     return if item && equip_slots[slot_id] != item.etype_id
  1005.     if item.nil?
  1006.       @equips[slot_id] = Game_CustomEquip.new
  1007.     else
  1008.       @equips[slot_id] = item
  1009.     end
  1010.     refresh
  1011.   end
  1012.   
  1013.   def gain_ap(ap)
  1014.     if Equipment_Skills::Learn_Skills
  1015.       for item in @equips
  1016.         if item.is_weapon?
  1017.           unless Equipment_Skills::Weapons[item.id] == nil
  1018.             for skill in Equipment_Skills::Weapons[item.id]
  1019.               if @ap[skill[1]] == nil
  1020.                 @ap[skill[1]] = 0
  1021.               end
  1022.               last_ap = @ap[skill[1]]
  1023.               @ap[skill[1]] += ap if skill[0] <= item.level
  1024.               if last_ap < Equipment_Skills.get_ap_cost(skill[1]) and Equipment_Skills.get_ap_cost(skill[1]) <= @ap[skill[1]]
  1025.                 SceneManager.scene.add_message(actor.name + " learns " + $data_skills[skill[1]].name + ".")
  1026.               end
  1027.             end
  1028.           end
  1029.         end
  1030.         if item.is_armor?
  1031.           unless Equipment_Skills::Armors[item.id] == nil
  1032.             for skill in Equipment_Skills::Armors[item.id]
  1033.               if @ap[skill[1]] == nil
  1034.                 @ap[skill[1]] = 0
  1035.               end
  1036.               last_ap = @ap[skill[1]]
  1037.               @ap[skill[1]] += ap if skill[0] <= item.level
  1038.               if last_ap < Equipment_Skills.get_ap_cost(skill[1]) and Equipment_Skills.get_ap_cost(skill[1]) <= @ap[skill[1]]
  1039.                 SceneManager.scene.add_message(actor.name + " learns " + $data_skills[skill[1]].name + ".")
  1040.               end
  1041.             end
  1042.           end
  1043.         end
  1044.       end
  1045.     end
  1046.   end
  1047.   
  1048.   def refresh
  1049.     eqskills_refresh
  1050.     for item in @equips
  1051.       if item.is_weapon?
  1052.         unless Equipment_Skills::Weapons[item.id] == nil
  1053.           for skill in Equipment_Skills::Weapons[item.id]
  1054.             learn_skill(skill[1]) if skill[0] <= item.level
  1055.           end
  1056.         end
  1057.       end
  1058.       if item.is_armor?
  1059.         unless Equipment_Skills::Armors[item.id] == nil
  1060.           for skill in Equipment_Skills::Armors[item.id]
  1061.             learn_skill(skill[1]) if skill[0] <= item.level
  1062.           end
  1063.         end
  1064.       end
  1065.     end
  1066.     # relearn any class skills you may have forgotten
  1067.     self.class.learnings.each do |learning|
  1068.       learn_skill(learning.skill_id) if learning.level <= @level
  1069.     end
  1070.   end
  1071.   
  1072. end

  1073. class Game_CustomEquip < Game_BaseItem
  1074.   
  1075.   def level
  1076.     return @level
  1077.   end
  1078.   
  1079. end


  1080. class Window_EquipStatus < Window_Base
  1081.   
  1082.   def refresh(item = nil)
  1083.     eqskills_refresh
  1084.     contents.clear
  1085.     draw_actor_name(@actor, 4, 0) if @actor
  1086.     6.times {|i| draw_item(0, line_height * (1 + i), 2 + i) }
  1087.       unless item == nil
  1088.       if item.is_a?(RPG::Weapon)
  1089.         unless Equipment_Skills::Weapons[item.id] == nil
  1090.           skills = Equipment_Skills::Weapons[item.id]
  1091.         end
  1092.       end
  1093.       if item.is_a?(RPG::Armor)
  1094.         unless Equipment_Skills::Armors[item.id] == nil
  1095.           skills = Equipment_Skills::Armors[item.id]
  1096.         end
  1097.       end
  1098.       unless skills == nil
  1099.         change_color(normal_color)
  1100.         draw_text(4, 168, width, line_height, "Equipment Skills")
  1101.         change_color(system_color)
  1102.         i = 1
  1103.         for skill in skills
  1104.           draw_text(4, 168 + 24 * i, width, line_height, $data_skills[skill[1]].name + " (" + skill[0].to_s + ")")
  1105.           if Equipment_Skills::Learn_Skills and @actor.ap[skill[1]] == nil
  1106.             @actor.ap[skill[1]] = 0
  1107.           end
  1108.           i = i + 1
  1109.           if Equipment_Skills::Learn_Skills
  1110.             draw_current_and_max_values(4, 168 + 24 * i, width - 50, [@actor.ap[skill[1]],Equipment_Skills.get_ap_cost(skill[1])].min, Equipment_Skills.get_ap_cost(skill[1]), system_color, system_color)
  1111.             i = i + 1
  1112.           end
  1113.         end
  1114.       end
  1115.     end
  1116.   end
  1117.   
  1118. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
7
 楼主| 发表于 2012-3-16 11:22:00 | 只看该作者

恩转载【另一种规则的五灵仙术】

来源http://cobbtocs.co.uk/wp/
RUBY 代码复制
  1. =begin
  2. Skills Level Up Based on Usage Script
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  9. Allows you to learn new skills by using your existing skills.
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. You will need to edit module Skill_Uses, further instructions
  14. are located there.
  15. ----------------------
  16. Known bugs
  17. ----------------------
  18. None
  19. =end
  20. module Skill_Uses
  21.  
  22.   SKILLS = []
  23.   # Add/Edit lines like the one below
  24.   # SKILLS[ORIGINAL] = [NEW, USES, REPLACE] REPLACE should be true or false
  25.   SKILLS[3] = [4, 50, true]
  26.   # Reads as: When using skill 3 for it's 50th time replace it with skill 4
  27.  
  28. end
  29.  
  30. class Game_Actor < Game_Battler
  31.   #--------------------------------------------------------------------------
  32.   # ● Aliases setup
  33.   #--------------------------------------------------------------------------
  34.   alias fomar0003_setup setup
  35.   def setup(actor_id)
  36.     fomar0003_setup(actor_id)
  37.     @skill_uses = []
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● New Method add_skill_use
  41.   #--------------------------------------------------------------------------
  42.   def add_skill_use(id)
  43.     if @skill_uses[id] == nil
  44.       @skill_uses[id] = 0
  45.     end
  46.     @skill_uses[id] += 1
  47.     unless Skill_Uses::SKILLS[id] == nil
  48.       if @skill_uses[id] == Skill_Uses::SKILLS[id][1]
  49.         learn_skill(Skill_Uses::SKILLS[id][0])
  50.         forget_skill(id) if Skill_Uses::SKILLS[id][2]
  51.         SceneManager.scene.add_text(@name + " learns " + $data_skills[Skill_Uses::SKILLS[id][0]].name + ".")
  52.       end
  53.     end
  54.   end
  55. end
  56.  
  57. class Game_Battler < Game_BattlerBase
  58.   #--------------------------------------------------------------------------
  59.   # ● Aliases item_apply
  60.   #--------------------------------------------------------------------------
  61.   alias fomar0004_item_apply item_apply
  62.   def item_apply(user, item)
  63.     if user.is_a?(Game_Actor) and item.is_a?(RPG::Skill)
  64.       user.add_skill_use(item.id)
  65.     end
  66.     fomar0004_item_apply(user, item)
  67.   end
  68. end
  69.  
  70. class Scene_Battle < Scene_Base
  71.   #--------------------------------------------------------------------------
  72.   # ● New method add_text
  73.   #--------------------------------------------------------------------------
  74.   def add_text(text)
  75.     @log_window.add_text(text)
  76.   end
  77. end

这个是这样规则
比如说10次冰咒,学会雨润,然后20次雨润,学会烟水,用100000次冰咒也没用。就是这样的。不过还是不支持复合仙术。
签名是什么?可以吃么?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
8
 楼主| 发表于 2012-3-16 11:27:20 | 只看该作者

【cobbtocs】缴械状态

来源http://cobbtocs.co.uk/wp
RUBY 代码复制
  1. =begin
  2. Transformation States
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. This script allows you to transform in battle through the
  9. application of states.
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. Notetag the states:
  14. <transformclass x>
  15. Where x is the class id of the class you want to use.
  16. <transformequips x>
  17. <transformequips x,x>
  18. <transformequips x,x,x,x,x>
  19. Where x = -1 -> Use the original equipment
  20. Where x = 0  -> Blank the equipment
  21. Where x > 0  -> Use the equipment of id
  22. Note your current equipment is copied and then the changes
  23. are applied. So you only need as many entries to cover you
  24. upto the last piece of equipment you want to change.
  25.  
  26. Note: Both are optional so use them as you want.
  27. <transformequips 0> for example could be used for a disarm state.
  28. ----------------------
  29. Known bugs
  30. ----------------------
  31. None
  32. =end
  33. class Game_Actor < Game_Battler
  34.  
  35.   def transform_class
  36.     for state in @states
  37.       if $data_states[state].transform_class > 0
  38.         return $data_states[state].transform_class
  39.       end
  40.     end
  41.     return 0
  42.   end
  43.  
  44.   def transform_equips
  45.     for state in @states
  46.       unless $data_states[state].transform_equips == []
  47.         return $data_states[state].transform_equips
  48.       end
  49.     end
  50.     return []
  51.   end
  52.  
  53.   alias ft_class class
  54.   def class
  55.     if transform_class > 0
  56.       $data_classes[transform_class]
  57.     else
  58.       ft_class
  59.     end
  60.   end
  61.  
  62.   alias ft_skills skills
  63.   def skills
  64.     if transform_class > 0
  65.       skills = []
  66.       self.class.learnings.each do |learning|
  67.         skills.push($data_skills[learning.skill_id]) if learning.level <= @level
  68.       end
  69.       return skills
  70.     else
  71.       ft_skills
  72.     end
  73.   end
  74.  
  75.   alias ft_equips equips
  76.   def equips
  77.     unless transform_equips == []
  78.       equip_ids = transform_equips
  79.       new_equips = ft_equips
  80.       for i in 0..equip_ids.size - 1
  81.         if equip_ids[i] == -1
  82.           new_equips[i] = @equips[i].object
  83.         elsif equip_ids[i] == 0
  84.           new_equips[i] = nil
  85.         else
  86.           if index_to_etype_id(i) == 0
  87.             new_equips[i] = $data_weapons[equip_ids[i]]
  88.           else
  89.             new_equips[i] = $data_armors[equip_ids[i]]
  90.           end
  91.         end
  92.       end
  93.       return new_equips
  94.     else
  95.       ft_equips
  96.     end
  97.   end
  98.  
  99. end
  100.  
  101. module RPG
  102.   class State
  103.  
  104.     def transform_class
  105.       if @note =~ /<transformclass (.*)>/i
  106.         return $1.to_i
  107.       end
  108.       return 0
  109.     end
  110.  
  111.     def transform_equips
  112.       if @note =~ /<transformequips (.*)>/i
  113.         equips = []
  114.         for equip in $1.split(",")
  115.           equips.push(equip.to_i)
  116.         end
  117.         return equips
  118.       end
  119.       return []
  120.     end
  121.  
  122.   end
  123. end

比如说状态备注:<transformequips 0>就代表缴械。其他功能请看说明。
签名是什么?可以吃么?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

醉啸 长风万里

梦石
0
星屑
6182
在线时间
6594 小时
注册时间
2007-12-16
帖子
4501

贵宾

9
发表于 2012-3-16 11:35:31 手机端发表。 | 只看该作者
建议不要开那么多帖,直接弄一个脚本整合吧

点评

倒也不是不可以。。。。不过fom脚本虽然实用若是全整合起来也很冗长啊。。。。  发表于 2012-3-16 11:37

评分

参与人数 1星屑 +12 收起 理由
无双sxa + 12 我很赞同

查看全部评分


还在龟速填坑中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
994 小时
注册时间
2011-7-24
帖子
506
10
发表于 2012-3-16 11:48:12 | 只看该作者
其实我见过最怪的就是最终幻想可以攻击自己人的设定,好蛋疼
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-21 22:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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