赞 | 675 |
VIP | 62 |
好人卡 | 144 |
积分 | 336 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33625
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 feizhaodan 于 2013-5-18 09:26 编辑
在论坛里好像没看见过关于角色战斗力方面的内容,于是本人写了个角色战斗力的小脚本,
虽然很简单,但是有需要的可直接拿去,免去写脚本的时间。
**********************************************************************************************
唔~,修改了一下,加入了敌人战斗力~~~~~,另外,在战斗帮助栏里增加描绘角色和敌人的战斗力。
**********************************************************************************************
设置和说明请看下面的脚本
截图(好像不需要吧,但还是弄一张)
脚本- #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
- =begin
- ===============================================================================
- ★【战斗力】★
- -------------------------------------------------------------------------------
- by -> 芯☆淡茹水
- ===============================================================================
- ◎ 使用方法:复制该脚本,插入到 main 前。
- -------------------------------------------------------------------------------
- 该脚本在状态窗口增加描绘角色战斗力,在帮助栏增加描绘角色和敌人的战斗力。
- 要在其他地方描绘角色战斗力,在欲描绘的地方写入:draw_actor_ce(actor, x, y)
- 敌人:draw_enemy_ce(enemy, x, y)
- 欲调用战斗力数值,先指定角色/敌人,然后:actor.ce / enemy.ce
- ===============================================================================
- ◆ 角色战斗力的构成:
- -------------------------------------------------------------------------------
- 1.角色:力量 + 敏捷 + 速度 + 魔力
- -------------------------------------------------------------------------------
- 2.武器:攻击力 + 物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
- + 属性攻击数 X 100 + 附加状态数 X 100 + 解除状态数 X 50
- -------------------------------------------------------------------------------
- 3.防具:物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
- + 属性防御数 X 100 + 状态防御数 X 100 + 自动状态 X 100
- -------------------------------------------------------------------------------
- 总战斗力 = 1(角色)+ 2(武器)+ 3(防具)
- ===============================================================================
- ◆ 敌人战斗力的构成:
- --------------------------------------------------------------------------------
- 敌人战斗力 = 力量 + 敏捷 + 速度 + 魔力 + 攻击力 + 物防 + 魔防 + 回避
- ===============================================================================
- =end #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 武器品质
- #--------------------------------------------------------------------------
- def weapon_quality(id)
- weapon = $data_weapons[id]
- n = weapon.atk + weapon.pdef + weapon.mdef + weapon.str_plus +
- weapon.dex_plus + weapon.agi_plus + weapon.int_plus
- if weapon.element_set != nil
- n += weapon.element_set.size * 100
- end
- if weapon.plus_state_set != nil
- n += weapon.plus_state_set.size * 100
- end
- if weapon.minus_state_set != nil
- n += weapon.minus_state_set.size * 50
- end
- return n
- end
- #---------------------------------------------------------------------------
- #● 防具品质
- #---------------------------------------------------------------------------
- def armor_quality(id)
- armor = $data_armors[id]
- n = armor.pdef + armor.mdef + armor.str_plus + armor.dex_plus +
- armor.agi_plus + armor.int_plus
- if armor.guard_element_set != nil
- n += armor.guard_element_set.size * 100
- end
- if armor.guard_state_set != nil
- n += armor.guard_state_set.size * 100
- end
- if armor.auto_state_id > 0
- n += 100
- end
- return n
- end
- #---------------------------------------------------------------------------
- #● 角色战斗力
- #---------------------------------------------------------------------------
- def ce
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n = str + dex + agi + int
- n += weapon != nil ? weapon_quality(@weapon_id) : 0
- n += armor1 != nil ? armor_quality(@armor1_id) : 0
- n += armor2 != nil ? armor_quality(@armor2_id) : 0
- n += armor3 != nil ? armor_quality(@armor3_id) : 0
- n += armor4 != nil ? armor_quality(@armor4_id) : 0
- return n
- end
- end
- #==============================================================================
- class Window_Base < Window
- #---------------------------------------------------------------------------
- #● 战斗力描绘
- #---------------------------------------------------------------------------
- def draw_actor_ce(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 96, 32, "战斗力:")
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 94, y, 164, 32, actor.ce.to_s)
- end
- #---------------------------------------------------------------------------
- #● 敌人战斗力描绘
- #---------------------------------------------------------------------------
- def draw_enemy_ce(enemy, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 96, 32, "战斗力:")
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 94, y, 164, 32, enemy.ce.to_s)
- end
- end
- #==============================================================================
- class Window_Status < Window_Base
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 40, 112)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 4 + 144, 0)
- draw_actor_level(@actor, 96, 32)
- draw_actor_state(@actor, 96, 64)
- draw_actor_hp(@actor, 96, 112, 172)
- draw_actor_sp(@actor, 96, 144, 172)
- draw_actor_parameter(@actor, 96, 192, 0)
- draw_actor_parameter(@actor, 96, 224, 1)
- draw_actor_parameter(@actor, 96, 256, 2)
- draw_actor_parameter(@actor, 96, 304, 3)
- draw_actor_parameter(@actor, 96, 336, 4)
- draw_actor_parameter(@actor, 96, 368, 5)
- draw_actor_parameter(@actor, 96, 400, 6)
- self.contents.font.color = system_color
- self.contents.draw_text(320, 48, 80, 32, "EXP")
- self.contents.draw_text(320, 80, 80, 32, "NEXT")
- draw_actor_ce(@actor, 319, 120)
- self.contents.font.color = normal_color
- self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
- self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(320, 160, 96, 32, "装备")
- draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
- draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
- draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
- draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
- draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
- end
- def dummy
- self.contents.font.color = system_color
- self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
- self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
- self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
- self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
- self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
- draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
- draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
- draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
- draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
- draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
- end
- end
- class Game_Enemy < Game_Battler
- #============================================================================
- def ce
- n = base_str + base_dex + base_agi + base_int + base_atk + base_pdef +
- base_mdef + base_eva
- return n
- end
- end
- #==============================================================================
- class Window_Help < Window_Base
- def set_actor(actor)
- if actor != @actor
- self.contents.clear
- draw_actor_name(actor, 4, 0)
- draw_actor_ce(actor, 460, 0)
- draw_actor_state(actor, 102, 0)
- draw_actor_hp(actor, 184, 0)
- draw_actor_sp(actor, 320, 0)
- [url=home.php?mod=space&uid=95897]@actor[/url] = actor
- @text = nil
- self.visible = true
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置敌人
- # enemy : 要显示名字和状态的敌人
- #--------------------------------------------------------------------------
- def set_enemy(enemy)
- text = enemy.name
- draw_enemy_ce(enemy, 460, 0)
- state_text = make_battler_state_text(enemy, 112, false)
- if state_text != ""
- text += " " + state_text
- end
- set_text(text, 1)
- end
- end
- #==============================================================================
-
复制代码 |
评分
-
查看全部评分
|