Project1
标题:
求问如何让怪物死后掉落的物品…
[打印本页]
作者:
君の傍にいる
时间:
2012-5-28 18:56
标题:
求问如何让怪物死后掉落的物品…
求问如何让怪物死后掉落的同样的道具只显示一次 比如 本来是 获得3个 大便 然后就提示三次 可以让他直接提示大便X3吗? dsu_plus_rewardpost_czw
作者:
灵魂の补给
时间:
2012-5-28 19:57
情把提示物品得失脚本附上偶才好修改啊!
不过好像就是只显示1次饿?
作者:
hys111111
时间:
2012-5-28 22:03
试验成功!把脚本发上来……
效果图:
null15.jpg
(65.29 KB, 下载次数: 7)
下载附件
保存到相册
2012-5-28 22:02 上传
脚本:(在Main前面插入)
#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
# 战斗结束时、显示获得的 EXP 及金钱的窗口。
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# exp : EXP
# gold : 金钱
# treasures : 宝物
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures,number)
@exp = exp
@gold = gold
@treasures = treasures
@number = number
super(160, 0, 320, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("EXP").width
self.contents.draw_text(x, 0, 64, 32, "EXP")
x += cx + 16
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in
[email protected]
draw_item_name(@treasures[item], 4, y)
self.contents.draw_text(100, y, 64, 32, "×"+@number[item].to_s)
y += 32
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
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# 限制宝物数为 6 个
# treasures = treasures[0..5]
# 获得 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
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
real_trea = []
number = []
for real in treasures
if real_trea.include?(real)
number[real_trea.index(real)] += 1
else
real_trea.push(real)
number.push(1)
end
end
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 生成战斗结果窗口
@result_window = Window_BattleResult.new(exp, gold, real_trea,number)
# 设置等待计数
@phase5_wait_count = 100
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1