赞 | 5 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 620
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023
|
8楼
楼主 |
发表于 2008-1-30 07:55:59
|
只看该作者
完成!!
探查+偷窃+四格掉宝
可探查怪物身上所能偷窃的宝物,不能被偷窃的宝物用四格掉宝来掉
探查与偷窃部分是修改绿发的脚本
掉宝部分是修改SailCat大的脚本
探查部分:
- #==============================================================================
- # 探查技能 BY绿发的Eclair
- #------------------------------------------------------------------------------
- # 使用方法:在数据库中设定一个叫“探查”的状态(想要用别的名字在下面改啦~)
- # 然后把想要做成有探查效果的特技或物品附加这个状态。就这样简单~~
- # 修改自然属性的个数在第16行。
- #==============================================================================
- # 探查技能加强 BY snstar2006
- #------------------------------------------------------------------------------
- # 加强部分:
- # 1. 敌人的属性为[王]的话,HP和SP不会显示,直到HP少於一半才会显示。
- # 2. 用变数做技能等级,可以直接用事件升级、降级。
- # 3. 可以设置不同能力所需要的等级。等级不够时显示为????。
- # 4. 设置为四格掉宝内的宝物看不见。
- #==============================================================================
- $探查状态名 = "探查" # 探查状态的名字
- $eye_level = 1 # 探查技能等级的变数ID
- $头目属性名 = "王"
- # 探查能力的等级
- $eye_level_ability = [0, 1, 2, 3, 4, 5, 0, 7, 8, 9, 10, 11, 12, 13, 14]
- # 依次为:
- # 0->名称 、1->HP+SP、2->HP+SP Max、3->种族、
- # 4->经验 、5->金钱 、6->掉落物 、7->攻击、
- # 8->物防 、9->魔防 、10->力量 、11->灵巧、
- # 12->速度、13->魔力、14->属性有效度
- $text_4_unknown = "????" # 未知时的文字
- 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 #自然属性个数
- @race = 8
- end
- def set_target(target)
- self.contents.clear
- self.visible = true
- @target = target
-
- if $game_variables[$eye_level] >= $eye_level_ability[0]
- self.contents.draw_text(10,10,360-32,32,"#{@target.name}",0)
- else
- self.contents.draw_text(10,10,360-32,32,$text_4_unknown,0)
- end
-
-
- # 描绘种族
- self.contents.font.color = system_color
- self.contents.draw_text(10,100,180,32,"种族",0)
- self.contents.font.color = normal_color
- for i in @element + 1..@element+1+@race
- if @target.element_rate(i) > 100
- race = $data_system.elements[i]
- break
- end
- end
-
- # 獲取是否為頭目
- for i in @element + 2 + @race..$data_system.elements.size
- unless $data_system.elements[i] == $头目属性名
- # 检验是否显示HP/SP
- if (@target.hp)<=(@target.maxhp/2)
- @show_hsp = true
- else
- @show_hsp = false
- end
- else
- @show_hsp = true
- end
- end
-
- # 描绘HP
- draw_actor_hp(@target,10,100 - 32 - 25,160)
- # 描绘SP
- draw_actor_sp(@target,10,100 - 32,160)
-
-
- if $game_variables[$eye_level] >= $eye_level_ability[3]
- self.contents.draw_text(70,100,100,32,race,2)
- else
- self.contents.draw_text(70,100,100,32,$text_4_unknown,2)
- end
-
- # 目标是敌方角色的场合
- 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
- if $game_variables[$eye_level] >= $eye_level_ability[4]
- self.contents.draw_text(190,100 - 32 - 25,180 - 32,32,"#{@target.exp}",2)
- else
- self.contents.draw_text(190,100 - 32 - 25,180 - 32,32,$text_4_unknown,2)
- end
- # 描绘金钱
- 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
- if $game_variables[$eye_level] >= $eye_level_ability[5]
- self.contents.draw_text(190,100 - 32,180-32,32,"#{@target.gold}",2)
- else
- self.contents.draw_text(190,100 - 32,180-32,32,$text_4_unknown,2)
- end
- # 描绘掉落物
- self.contents.font.color = system_color
- self.contents.draw_text(190,100 ,180,32,"携带",0)
- self.contents.font.color = normal_color
- if $game_variables[$eye_level] >= $eye_level_ability[6]
- if (target.item_id > 0 or target.weapon_id != 0 or target.armor_id != 0)
- 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
- else
- self.contents.draw_text(190,57+75,180-32,32,"无",2)
- end
- else
- self.contents.draw_text(197,57 + 75,180-32,32,$text_4_unknown,2)
- end
- end
-
- # 描绘攻击
- if $game_variables[$eye_level] >= $eye_level_ability[7]
- draw_actor_parameter(@target, 10, 112 + 20, 0)
- else
- draw_actor_parameter_u(10, 112 + 20, 0)
- end
- # 描绘物理防御
- if $game_variables[$eye_level] >= $eye_level_ability[8]
- draw_actor_parameter(@target, 10, 144 + 20, 1)
- else
- draw_actor_parameter_u(10, 144 + 20, 1)
- end
- # 描绘魔法防御
- if $game_variables[$eye_level] >= $eye_level_ability[9]
- draw_actor_parameter(@target, 10, 176 + 20, 2)
- else
- draw_actor_parameter_u(10, 176 + 20, 2)
- end
- # 描绘力量
- if $game_variables[$eye_level] >= $eye_level_ability[10]
- draw_actor_parameter(@target, 10, 208 + 20, 3)
- else
- draw_actor_parameter_u(10, 208 + 20, 3)
- end
- # 描绘灵巧
- if $game_variables[$eye_level] >= $eye_level_ability[11]
- draw_actor_parameter(@target, 10, 240 + 20, 4)
- else
- draw_actor_parameter_u(10, 240 + 20, 4)
- end
- # 描绘速度
- if $game_variables[$eye_level] >= $eye_level_ability[12]
- draw_actor_parameter(@target, 10, 272 + 20, 5)
- else
- draw_actor_parameter_u(10, 272 + 20, 5)
- end
- # 描绘魔力
- if $game_variables[$eye_level] >= $eye_level_ability[13]
- draw_actor_parameter(@target, 10, 304 + 20, 6)
- else
- draw_actor_parameter_u(10, 304 + 20, 6)
- 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[i]
- when 101..150
- weak += $data_system.elements[i]
- when 1..99
- resist += $data_system.elements[i]
- when 0
- guard += $data_system.elements[i]
- when -200..-1
- recover += $data_system.elements[i]
- end
- end
- if $game_variables[$eye_level] >= $eye_level_ability[14]
- 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
- else
- self.contents.draw_text(190,153 + 32+ 12 + 32 * y,180,32,$text_4_unknown,0)
- end
-
- 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
-
- def draw_actor_parameter_u(x, y, type)
- case type
- when 0
- parameter_name = $data_system.words.atk
- when 1
- parameter_name = $data_system.words.pdef
- when 2
- parameter_name = $data_system.words.mdef
- when 3
- parameter_name = $data_system.words.str
- when 4
- parameter_name = $data_system.words.dex
- when 5
- parameter_name = $data_system.words.agi
- when 6
- parameter_name = $data_system.words.int
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, 32, $text_4_unknown, 2)
- end
- def draw_actor_hp(actor, x, y, width = 144)
- # Draw "HP" text string
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
- # Calculate if there is draw space for MaxHP
- if width - 32 >= 108
- hp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- hp_x = x + width - 48
- flag = false
- end
- # Draw HP
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- if $game_variables[$eye_level] >= $eye_level_ability[1] and @show_hsp
- self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
- else
- self.contents.draw_text(hp_x, y, 48, 32, $text_4_unknown, 2)
- end
- # Draw MaxHP
- if flag
- self.contents.font.color = normal_color
- self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
- if $game_variables[$eye_level] >= $eye_level_ability[2] and @show_hsp
- self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
- else
- self.contents.draw_text(hp_x + 60, y, 48, 32, $text_4_unknown)
- end
- end
- end
- def draw_actor_sp(actor, x, y, width = 144)
- # Draw "SP" text string
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
- # Calculate if there is draw space for MaxHP
- if width - 32 >= 108
- sp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- sp_x = x + width - 48
- flag = false
- end
- # Draw SP
- self.contents.font.color = actor.sp == 0 ? knockout_color :
- actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
- if $game_variables[$eye_level] >= $eye_level_ability[1] and @show_hsp
- self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
- else
- self.contents.draw_text(sp_x, y, 48, 32, $text_4_unknown, 2)
- end
- # Draw MaxSP
- if flag
- self.contents.font.color = normal_color
- self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
- if $game_variables[$eye_level] >= $eye_level_ability[2] and @show_hsp
- self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
- else
- self.contents.draw_text(sp_x + 60, y, 48, 32, $text_4_unknown)
- end
- end
- 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[i].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
- #==============================================================================
- # 探查技能 BY绿发的Eclair
- # 加強 BY snstar2006
- #==============================================================================
复制代码
掉宝部分:
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # ============================================================================
- # 四格掉宝设定 by SailCat
- # fix by snstar2006
- # ============================================================================
- # 脚本使用说明:
- # 1.复制后插入到Main前面
- # 2.数据库设定额外掉宝的概率,在敌人名称那里
- # 格式: 敌人名称,宝物1,宝物2,宝物3,宝物4
- # 宝物写法: (I|W|A)n 分别对应: n号道具,n号武器,n号防具 I W A必须大写
- # 例: Cockatrice,A5,I5,W3
- # Fishman,I2,I3
- # 三栏中任一栏留空不写时,取前一格的设定,全都不写时,就没有宝物。
- # 3.186行是四格概率比设定,在那里填上4个数字就可以更改概率了,该行内容:
- # rarity = [178, 51, 15, 12]
- # ============================================================================
- # 修改部分:
- # 1. 掉的宝物设置在敌人名称之後,设置4个
- # 2. 默认的宝物栏用来当作偷窃用的「携带物」,不会掉落。
- #--------------------------------------------------------------------------
- # □ RPG::Enemy
- #--------------------------------------------------------------------------
- module RPG
- class Enemy
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ""
- end
- def treasure1
- treasure = @name.split(/,/)[1]
- return treasure.to_s
- end
- def treasure2
- treasure = @name.split(/,/)[2]
- return treasure.to_s
- end
- def treasure3
- treasure = @name.split(/,/)[3]
- return treasure.to_s
- end
- def treasure4
- treasure = @name.split(/,/)[4]
- return treasure.to_s
- end
- end
- end
- #==============================================================================
- # ■ Game_Enemy
- #------------------------------------------------------------------------------
- # 处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的
- # 内部使用。
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ● 获取物品 ID1
- #--------------------------------------------------------------------------
- def item1_id
- if $data_enemies[@enemy_id].treasure1 == ""
- return item_id
- elsif $data_enemies[@enemy_id].treasure1[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure1[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID1
- #--------------------------------------------------------------------------
- def weapon1_id
- if $data_enemies[@enemy_id].treasure1 == ""
- return weapon_id
- elsif $data_enemies[@enemy_id].treasure1[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure1[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID1
- #--------------------------------------------------------------------------
- def armor1_id
- if $data_enemies[@enemy_id].treasure1 == ""
- return armor_id
- elsif $data_enemies[@enemy_id].treasure1[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure1[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品 ID2
- #--------------------------------------------------------------------------
- def item2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return item_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID2
- #--------------------------------------------------------------------------
- def weapon2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return weapon_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID2
- #--------------------------------------------------------------------------
- def armor2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return armor_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品 ID3
- #--------------------------------------------------------------------------
- def item3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return item2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID3
- #--------------------------------------------------------------------------
- def weapon3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return weapon2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID3
- #--------------------------------------------------------------------------
- def armor3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return armor2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品 ID4
- #--------------------------------------------------------------------------
- def item4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return item3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID4
- #--------------------------------------------------------------------------
- def weapon4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return weapon3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID4
- #--------------------------------------------------------------------------
- def armor4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return armor3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #------------------------------------------------------------------------------
- # 处理战斗画面的类。
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 开始结束战斗回合
- #--------------------------------------------------------------------------
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 初始化 EXP、金钱、宝物
- exp = 0
- gold = 0
- treasures = []
- # 循环
- for enemy in $game_troop.enemies
- # 敌人不是隐藏状态的情况下
- unless enemy.hidden
- # 获得 EXP、增加金钱
- exp += enemy.exp
- gold += enemy.gold
- # 出现宝物判定
- if rand(100) < enemy.treasure_prob
- rarity = [178, 51, 15, 12]
- case rand(rarity[0] + rarity[1] + rarity[2]+ rarity[3])
- when 0..rarity[0] - 1
- if enemy.item1_id > 0
- treasures.push($data_items[enemy.item1_id])
- end
- if enemy.weapon1_id > 0
- treasures.push($data_weapons[enemy.weapon1_id])
- end
- if enemy.armor1_id > 0
- treasures.push($data_armors[enemy.armor1_id])
- end
- when rarity[0]..rarity[0] + rarity[1] - 1
- if enemy.item2_id > 0
- treasures.push($data_items[enemy.item2_id])
- end
- if enemy.weapon2_id > 0
- treasures.push($data_weapons[enemy.weapon2_id])
- end
- if enemy.armor2_id > 0
- treasures.push($data_armors[enemy.armor2_id])
- end
- when rarity[0] + rarity[1]..rarity[0] + rarity[1] + rarity[2] - 1
- if enemy.item3_id > 0
- treasures.push($data_items[enemy.item3_id])
- end
- if enemy.weapon3_id > 0
- treasures.push($data_weapons[enemy.weapon3_id])
- end
- if enemy.armor3_id > 0
- treasures.push($data_armors[enemy.armor3_id])
- end
- else
- if enemy.item4_id > 0
- treasures.push($data_items[enemy.item4_id])
- end
- if enemy.weapon4_id > 0
- treasures.push($data_weapons[enemy.weapon4_id])
- end
- if enemy.armor4_id > 0
- treasures.push($data_armors[enemy.armor4_id])
- end
- end
- end
- end
- end
- # 限制宝物数为 8 个
- treasures = treasures[0..7]
- # 获得 EXP
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- # 获得金钱
- $game_party.gain_gold(gold)
- # 获得宝物
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- # 生成战斗结果窗口
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- # 设置等待计数
- @phase5_wait_count = 100
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码
偷窃部分:
|
|