- #==============================================================================# ■ 【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 = idend#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★# 注册【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 endend#==============================================================================# ■ 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 endend #==============================================================================# ■ 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 endendend复制代码
复制代码 本帖来自P1论坛作者忧雪の伤,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址: https://rpg.blue/forum.php?mod=viewthread&tid=168527 若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。 |