赞 | 0 |
VIP | 5 |
好人卡 | 0 |
积分 | 6 |
经验 | 5677 |
最后登录 | 2024-10-20 |
在线时间 | 156 小时 |
Lv2.观梦者 秀才
- 梦石
- 0
- 星屑
- 592
- 在线时间
- 156 小时
- 注册时间
- 2008-7-23
- 帖子
- 290
|
5楼
楼主 |
发表于 2012-7-15 10:08:00
|
只看该作者
本帖最后由 z121310 于 2012-7-15 12:51 编辑
明特·布兰马修 发表于 2012-7-14 23:33
请给脚本或者工程范例啊
谢谢配合
#==============================================================================
# 探查技能 BY绿发的Eclair
#------------------------------------------------------------------------------
# 使用方法:在数据库中设定一个叫“探查”的状态(想要用别的名字在下面改啦~)
# 然后把想要做成有探查效果的特技或物品附加这个状态。就这样简单~~
# 修改自然属性的个数在第16行。
#==============================================================================
$探查状态名 = "探查" #探查状态的名字
class Window_cateyes < Window_Base
def initialize
super(120,40,400,400)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 9999
self.back_opacity = 160 #信息窗口的透明度
@element = 8 #自然属性个数
end
def set_target(target)
self.contents.clear
self.visible = true
@target = target
self.contents.draw_text(10,10,360-32,32,"#{@target.name}",0)
draw_actor_hp(@target,10,100 - 32 - 25,160)
draw_actor_sp(@target,10,100 - 32,160)
self.contents.font.color = system_color
self.contents.draw_text(10,100,180,32,"种族",0)
draw_actor_parameter(@target, 10, 112 + 20, 0)
draw_actor_parameter(@target, 10, 144 + 20, 1)
draw_actor_parameter(@target, 10, 176 + 20, 2)
draw_actor_parameter(@target, 10, 208 + 20, 3)
draw_actor_parameter(@target, 10, 240 + 20, 4)
draw_actor_parameter(@target, 10, 272 + 20, 5)
draw_actor_parameter(@target, 10, 304 + 20, 6)
if @target.is_a?(Game_Enemy)
self.contents.font.color = system_color
self.contents.draw_text(190,100 - 32 - 25,180-32,32,"经验",0)
self.contents.font.color = normal_color
self.contents.draw_text(190,100 - 32 - 25,180 - 32,32,"#{@target.exp}",2)
self.contents.font.color = system_color
self.contents.draw_text(190,100 - 32 ,180-32,32,$data_system.words.gold,0)
self.contents.font.color = normal_color
self.contents.draw_text(190,100 - 32,180-32,32,"#{@target.gold}",2)
self.contents.font.color = system_color
self.contents.draw_text(190,100 ,180,32,"掉落",0)
self.contents.font.color = normal_color
draw_item_name($data_items[@target.item_id],197,57 + 25 + 25 + 25) if @target.item_id > 0
draw_item_name($data_weapons[@target.weapon_id],197,57 + 25 + 25 + 25) if @target.weapon_id > 0
draw_item_name($data_armors[@target.armor_id],197,57 + 25 + 25 + 25) if @target.armor_id > 0
end
self.contents.font.color = system_color
self.contents.draw_text(190,153 + 12,180,32,"属性抵抗",0)
self.contents.font.color = normal_color
num = @element_max == 0 ? $data_system.elements.size : @element_max
y = 0
weaker = ""
weak = ""
resist = ""
guard = ""
recover = ""
race = ""
for i in 1..@element
case @target.element_rate(i)
when 151..200
weaker += $data_system.elements
when 101..150
weak += $data_system.elements
when 1..99
resist += $data_system.elements
when 0
guard += $data_system.elements
when -200..-1
recover += $data_system.elements
end
end
if weaker != ""
weaker += "超弱"
self.contents.draw_text(190,153 + 32+ 12,180,32,weaker,0)
y += 1
end
if weak != ""
weak += "弱点"
self.contents.draw_text(190,153 + 32+ 12 + 32 * y,180,32,weak,0)
y += 1
end
if resist != ""
resist += "抵抗"
self.contents.draw_text(190,153 + 32+ 12 + 32 * y,180,32,resist,0)
y += 1
end
if guard != ""
guard += "无效"
self.contents.draw_text(190,153 + 32+ 12 + 32 * y,180,32,guard,0)
y += 1
end
if recover != ""
recover += "吸收"
self.contents.draw_text(190,153 + 32+ 12 + 32 * y,180,32,recover,0)
end
for i in @element + 1..$data_system.elements.size - 1
if @target.element_rate(i) > 100
race = $data_system.elements
break
end
end
self.contents.font.color = normal_color
self.contents.draw_text(70,100,100,32,race,2)
end
def draw_item_name(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 150, 32, item.name)
end
end
class Scene_Battle
alias update_phase4_step5_eclair2 :update_phase4_step5
def update_phase4_step5
for i in 1..$data_states.size - 1
if $data_states.name == $探查状态名
$探查状态ID = i
break
end
end
if (@active_battler.current_action.kind == 1 and $data_skills[@active_battler.current_action.skill_id].plus_state_set.include?($探查状态ID)) or (@active_battler.current_action.kind == 2 and $data_items[@active_battler.current_action.skill_id].plus_state_set.include?($探查状态ID))
@eye_window = Window_cateyes.new
for target in @target_battlers
target.damage = ""
@eye_window.set_target(target)
for i in 0...120
Input.update
@eye_window.update
Graphics.update
@spriteset.update
if Input.trigger?(Input::C) or Input.trigger?(Input::B)
$game_system.se_play($data_system.decision_se)
break
end
end
end
@eye_window.dispose
@eye_window = nil
end
update_phase4_step5_eclair2
end
end
|
|