赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 4830 |
最后登录 | 2021-12-13 |
在线时间 | 128 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 128 小时
- 注册时间
- 2011-7-13
- 帖子
- 32
|
6楼
楼主 |
发表于 2013-2-26 22:01:49
|
只看该作者
这是我修改的Game_Battler脚本- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :battler_name # 战斗图文件名称
- attr_reader :battler_hue # 战斗图色调
- attr_reader :hp # 体力值
- attr_reader :mp # 魔力值
- attr_reader :sp # SP值
- attr_reader :action # 战斗行动
- attr_accessor :hidden # 隐藏标志
- attr_accessor :immortal # 不死身标志
- attr_accessor :animation_id # 动画 ID
- attr_accessor :animation_mirror # 动画纵向翻转标志
- attr_accessor :white_flash # 白色屏幕闪烁标志
- attr_accessor :blink # 闪烁标志
- attr_accessor :collapse # 倒下标志
- attr_reader :skipped # 行动结果:跳过标志
- attr_reader :missed # 行动结果:落空标志
- attr_reader :evaded # 行动结果:闪躲标志
- attr_reader :critical # 行动结果:会心一击标志
- attr_reader :absorbed # 行动结果:吸收标志
- attr_reader :hp_damage # 行动结果:体力伤害标志
- attr_reader :mp_damage # 行动结果:魔力伤害标志
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- @battler_name = ""
- @battler_hue = 0
- @hp = 0
- @mp = 0
- @sp = 0 # SP
- @action = Game_BattleAction.new(self)
- @states = [] # 状态(ID数组)
- @state_turns = {} # 状态剩馀回合(哈希表)
- [url=home.php?mod=space&uid=292300]@Hidden[/url] = false
- @immortal = false
- clear_extra_values
- clear_sprite_effects
- clear_action_results
- end
- #--------------------------------------------------------------------------
- # ● 清除能力值变量
- #--------------------------------------------------------------------------
- def clear_extra_values
- @maxhp_plus = 0
- @maxmp_plus = 0
- @maxsp_plus = 0 # SP
- @atk_plus = 0
- @def_plus = 0
- @spi_plus = 0
- @agi_plus = 0
- end
复制代码- #--------------------------------------------------------------------------
- # ● 获取 MaxSP
- #--------------------------------------------------------------------------
- def maxsp
- return [[base_maxsp + @maxsp_plus, 1].max, 9999].min
- end
复制代码- #--------------------------------------------------------------------------
- # ● 设置 MaxSP
- # new_maxsp : 新的 MaxSP
- #--------------------------------------------------------------------------
- def maxsp=(new_maxsp)
- @maxsp_plus += new_maxsp - self.maxsp
- @maxsp_plus = [[@maxsp_plus, -9999].max, 9999].min
- @sp = [@sp, self.maxsp].min
- end
复制代码- #--------------------------------------------------------------------------
- # ● 更改 SP
- # mp : 新的 SP
- #--------------------------------------------------------------------------
- def sp=(sp)
- @sp = [[sp, maxsp].min, 0].max
- if @sp <= 10 and not state?(1) and not @immortal
- add_state(1) # 附加「无法战斗」状态(1号状态)
- @added_states.push(1)
- elsif @sp > 10 and state?(1)
- remove_state(1) # 移除「无法战斗」状态(1号状态)
- @removed_states.push(1)
- end
- end
复制代码- #--------------------------------------------------------------------------
- # ● 全回复
- #--------------------------------------------------------------------------
- def recover_all
- @hp = maxhp
- @mp = maxmp
- @mp = maxsp #SP
- for i in @states.clone do remove_state(i) end
- end
复制代码 然后是Game_Actor- #--------------------------------------------------------------------------
- # ● 获取基本SP最大值
- #--------------------------------------------------------------------------
- def base_maxsp
- return [url=home.php?mod=space&uid=22147]@level[/url] * 5 + 95
- end
复制代码- #--------------------------------------------------------------------------
- # ● 变更经验
- # exp : 新经验
- # show : 显示等级提示标志
- #--------------------------------------------------------------------------
- def change_exp(exp, show)
- last_level = @level
- last_skills = skills
- [url=home.php?mod=space&uid=13302]@exp[/url] = [[exp, 9999999].min, 0].max
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- level_up
- end
- while @exp < @exp_list[@level]
- level_down
- end
- @hp = [@hp, maxhp].min
- @mp = [@mp, maxmp].min
- @sp = [@sp, maxsp].min #SP
- if show and @level > last_level
- display_level_up(skills - last_skills)
- end
- end
- #--------------------------------------------------------------------------
- # ● 升级
- #--------------------------------------------------------------------------
- def level_up
- @level += 1
- self.hp += maxhp
- self.mp += maxmp
- self.sp += maxsp #SP
- for learning in self.class.learnings
- learn_skill(learning.skill_id) if learning.level == @level
- end
- end
复制代码 最后是Window_Base- #--------------------------------------------------------------------------
- # ● 获取SP值槽颜色1
- #--------------------------------------------------------------------------
- def sp_gauge_color1
- return text_color(20)
- end
- #--------------------------------------------------------------------------
- # ● 获取SP值槽颜色2
- #--------------------------------------------------------------------------
- def sp_gauge_color2
- return text_color(26)
- end
复制代码- #--------------------------------------------------------------------------
- # ● 获取SP文字颜色
- # actor : 角色
- #--------------------------------------------------------------------------
- def sp_color(actor)
- return knockout_color if actor.sp == 0
- return crisis_color if actor.sp < actor.maxsp / 4
- return normal_color
- end
复制代码- #--------------------------------------------------------------------------
- # ● 绘制角色SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标宽度
- #--------------------------------------------------------------------------
- def draw_actor_sp(actor, x, y, width = 160)
- draw_actor_sp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, "SP")
- self.contents.font.color = hp_color(actor)
- last_font_size = self.contents.font.size
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.sp, 2)
- else
- self.contents.draw_text(xr - 99, y, 44, WLH, actor.sp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxsp, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 绘制角色SP值槽
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标宽度
- #--------------------------------------------------------------------------
- def draw_actor_sp_gauge(actor, x, y, width = 160)
- gw = width * actor.sp / actor.maxsp
- gc1 = sp_gauge_color1
- gc2 = sp_gauge_color2
- n1 = Color.new(0,56,37,255)
- n2 = Color.new(0,159,37,255)
- n3 = Color.new(226,214,180,255)
- n4 = Color.new(0,0,0,255)
- n5 = Color.new(107,85,78,255)
- self.contents.fill_rect(x - 2, y + WLH - 10, width + 4, 10, n4)
- self.contents.fill_rect(x - 1, y + WLH - 9, width + 2, 8, n3)
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, n1, n2)
- end
复制代码 还有Window_Statue- #--------------------------------------------------------------------------
- # ● 绘制基础资料
- # x : 绘制点 X 座标
- # y : 绘制点 Y 座标
- #--------------------------------------------------------------------------
- def draw_basic_info(x, y)
- draw_actor_level(@actor, x, y + WLH * 0 + 6)
- draw_actor_state(@actor, x + 100 , y + WLH * 0 + 6)
- draw_actor_hp(@actor, x, y + WLH * 1 + 12)
- draw_actor_mp(@actor, x, y + WLH * 2 + 18)
- draw_actor_exp(@actor,x, y + WLH * 3 + 24)
- draw_actor_sp(@actor,x, y + WLH * 4 + 30)
- end
复制代码 大概就修改添加了这些地方 |
|