扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 151|回复: 0

[转载发布] 【ISA】战斗临时天气 - Battle Temp Weather

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    昨天 18:01
  • 签到天数: 114 天

    连续签到: 4 天

    [LV.6]常住居民II

    2338

    主题

    403

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10632
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13401

    灌水之王

    发表于 2024-4-19 18:59:44 | 显示全部楼层 |阅读模式
    1. #==============================================================================# ■ 【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在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-15 04:40 , Processed in 0.131317 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表