Project1
标题:
【ISA】战斗临时天气 - Battle Temp Weather
[打印本页]
作者:
忧雪の伤
时间:
2011-2-26 18:17
标题:
【ISA】战斗临时天气 - Battle Temp Weather
本帖最后由 忧雪の伤 于 2011-2-26 18:42 编辑
#==============================================================================
# ■ 【ISA】战斗临时天气 - Battle Temp Weather
#------------------------------------------------------------------------------
# - 2011.2.26
# 初始化 忧雪の伤
#______________________________________________________________________________
#
# 追加战斗临时天气以及对于技能的影响。
#
#==============================================================================
#==============================================================================
# ★ 设定部分 ★
#==============================================================================
module ISA
# 功能开关
BTW = true
# 生成天气颜色
BTW_TONE = []
BTW_TONE[1] = Tone.new(-128, -128, -32)
BTW_TONE[2] = Tone.new(0, 0, 0)
BTW_TONE[3] = Tone.new(0, 0, 0)
BTW_TONE[4] = Tone.new(0, 0, 0)
# 增效属性
BTW_ELE = []
BTW_ELE[1] = 17
# 不需要提高的设置为nil
BTW_ELE[2] = nil
BTW_ELE[3] = nil
BTW_ELE[4] = nil
# 提高值
BTW_UP = []
# 基准100
BTW_UP[1] = 200
BTW_UP[2] = 100
BTW_UP[3] = 100
BTW_UP[4] = 100
# 降效属性
BTW_ELE2 = []
BTW_ELE2[1] = 18
# 不需要降低的设置为nil
BTW_ELE2[2] = nil
BTW_ELE2[3] = nil
BTW_ELE2[4] = nil
# 降低值
BTW_DOWN = []
# 基准100
BTW_DOWN[1] = 50
BTW_DOWN[2] = 100
BTW_DOWN[3] = 100
BTW_DOWN[4] = 100
# 天气图片开关
BTW_PIC = true
# 天气图片名字
BTW_PIC_NAME = "WEATHER"
# 天气图片位置
BTW_PIC_GRA = "Pictures/"
# 天气图片X、Y坐标
BTW_PIC_X = 550
BTW_PIC_Y = 5
# 改变天气指令
# => $game_temp.battle_weather = id
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
# 注册【ISA】
$ISA = {} if $ISA == nil
$ISA["BTW"] = true
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ★ 开关判定 ★
#==============================================================================
if ISA::BTW == true then
#==============================================================================
# ■ Game_Temp
#------------------------------------------------------------------------------
# 在没有存档的情况下,处理临时数据的类。这个类的实例请参考
# $game_temp 。
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :battle_weather # 战斗画面天气
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
alias old_initialize initialize
def initialize
# 声明别名
@battle_weather = 0
# 调用其他
old_initialize
end
end
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# 处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
# 超级类来使用。
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● 属性修正计算
# element_set : 属性
#--------------------------------------------------------------------------
alias old_elements_correct elements_correct
def elements_correct(element_set)
# 调用旧值
n = old_elements_correct(element_set)
for i in element_set
# 读取属性
if ISA::BTW_ELE[$game_temp.battle_weather] != nil and i == ISA::BTW_ELE[$game_temp.battle_weather]
# 运算增幅
n *= ISA::BTW_UP[$game_temp.battle_weather] / 100
end
# 读取属性
if ISA::BTW_ELE2[$game_temp.battle_weather] != nil and i == ISA::BTW_ELE2[$game_temp.battle_weather]
# 运算增幅
n *= ISA::BTW_DOWN[$game_temp.battle_weather]
n /= 100
end
end
return n
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias old_main_third main
def main
# 声明别名
# 调用其他
old_main_third
@BTW_weather.dispose if @BTW_weather != nil
# 还原色调
$game_screen.start_tone_change(Tone.new(0, 0, 0), 20)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias old_update_second update
def update
# 声明别名
case $game_temp.battle_weather
# 改变色调
when 0 # 普通
$game_screen.start_tone_change(Tone.new(0, 0, 0), 20)
else # 其他
$game_screen.start_tone_change(ISA::BTW_TONE[$game_temp.battle_weather], 20)
end
if ISA::BTW_PIC
# 显示图片
@BTW_weather = Sprite.new if @BTW_weather == nil
@BTW_weather.bitmap = Bitmap.new("Graphics/" + ISA::BTW_PIC_GRA + ISA::BTW_PIC_NAME + $game_temp.battle_weather.to_s)
@BTW_weather.x = ISA::BTW_PIC_X
@BTW_weather.y = ISA::BTW_PIC_Y
end
# 调用其他
old_update_second
end
end
end
复制代码
作者:
liqunsz
时间:
2011-2-26 18:20
咕噜……加上了显示天气图片呢
作者:
越前リョーマ
时间:
2011-2-27 03:53
没范例也就算了,连截图什么的都没么 = =
作者:
忧雪の伤
时间:
2011-2-27 11:29
越前リョーマ 发表于 2011-2-27 03:53
没范例也就算了,连截图什么的都没么 = =
喂喂,你要我怎么给截图?这个是根据你的设定来发挥效果的啊……
作者:
禾西
时间:
2011-3-2 02:02
简单的脚本要啥截图pokemon没玩过吗?不过设置上的说明真的不足, 补点文字吧
作者:
姬文翔
时间:
2011-3-5 01:51
嗯……看不太懂怎么个用法啊……例如需要自己准备一些天气图片吗?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1