(ХР) SunRays

Больше
17 года 10 мес. назад #21513 от Enyo
Enyo создал тему: (ХР) SunRays
Автор: sandgolem
Описание: Скрипт случайно создает солнечные лучи, как утверждает автор: Этот скрипт могут использовать только  в играх с хорошим маппингом
Я же следующим скрин шотом(Красная Шапочка) доказываю обратное ;D

Инструкция: В парралельном эвенте поставте комнду Выполнить скрипт и пропишите: Sunray.create(К,З,С) , где К - красный, З - зеленый, С - синий цвета (0-255), далее поставте время ожидания
P.S. Рекомендую исполтьзовать этот скрипт в местах труднодоступных свету, например: Густой лес, Пещера и т.д.
[cut]
Code:
Sunray script (beta version) by sandgolem # For use only with good mapping : SG_Sunray_MaxStartOpacity = 15 SG_Sunray_MaxOpacity = 160 SG_Sunray_MaxHeight = 340 SG_Sunray_MaxWidth = 70 SG_Sunray_AppearTime = 150 SG_Sunray_FadeTime = 275 SG_Sunray_MaxWidthBase = 8 SG_Sunray_RGB = [155,220,255] class SG_Sunray   def initialize     reset   end     def reset     @sunrays.each{|i| i.dispose if !i.disposed?} if @sunrays && @sunrays != []     @sunrays = []     @duration = []   end   #  def pause #    return if @sunrays == [] #    for i in 0...@sunrays.size #      @sunrays[i].visible = false #    end #  end   #  def resume #    return if @sunrays == [] #    for i in 0...@sunrays.size #      @sunrays[i].visible = true #    end #  end     def create(r = SG_Sunray_RGB[0],g = SG_Sunray_RGB[1],b = SG_Sunray_RGB[2])     @r = r; @g = g; @b = b     this = @sunrays.size     @sunrays += [Sprite.new]     ray_height = 100 + rand(SG_Sunray_MaxHeight - 99)     ray_width = 12 + rand(SG_Sunray_MaxWidth - 11)     @sunrays[this].bitmap = Bitmap.new(ray_width,ray_height)     @opacity = 180 + rand(76)     basex = 2 + rand(SG_Sunray_MaxWidthBase - 2)     for i in 0...ray_height       opacity = (@opacity * ((ray_height - i) * 100 / ray_height) / 100) + 10       color = Color.new(@r,@g,@b,opacity)       k = (ray_width * (i * 100 / ray_height) / 100) + basex       for j in 0...k         @sunrays[this].bitmap.set_pixel(j,i,color)       end     end     @sunrays[this].x = rand(640 - ray_width)     @sunrays[this].y = rand(480 - ray_height)     @duration[this] = rand(60)     @sunrays[this].opacity = 2 + rand(SG_Sunray_MaxStartOpacity - 2)   end     def move(x,y)     return if @sunrays == []     for i in 0...@sunrays.size       @sunrays[i].x += x       @sunrays[i].y += y     end   end   def update     return if @sunrays == [] or !$scene.is_a?(Scene_Map)     for i in 0...@duration.size       @duration[i] += 1       if @duration[i] SG_Sunray_AppearTime         x = rand(2)         if x == 1 && @sunrays[i].opacity SG_Sunray_MaxOpacity           @sunrays[i].opacity += 1         end       elsif @duration[i] SG_Sunray_FadeTime         @sunrays[i].opacity -= 1         if @sunrays[i].opacity == 0           @sunrays[i] = nil           @duration[i] = nil         end       end     end     @sunrays.compact!     @duration.compact!   end end class Game_Player   alias sandgolem_sunray_down move_down   alias sandgolem_sunray_up move_up   alias sandgolem_sunray_left move_left   alias sandgolem_sunray_right move_right     def move_down     sandgolem_sunray_down     Sunray.move(0,-1) if moving? && @y % 2 == 0   end     def move_up     sandgolem_sunray_up     Sunray.move(0,1) if moving? && @y % 2 == 0   end     def move_left     sandgolem_sunray_left     Sunray.move(1,0) if moving? && @x % 2 == 0   end     def move_right     sandgolem_sunray_right     Sunray.move(-1,0) if moving? && @x % 2 == 0   end end class Game_Map   alias sandgolem_sunray_update update   alias sandgolem_sunray_setup setup     def setup(map_id)     sandgolem_sunray_setup(map_id)     Sunray.reset   end     def update     Sunray.update     sandgolem_sunray_update   end end #class Scene_Map #  alias sandgolem_sunray_main main   #  def main #    Sunray.resume #    sandgolem_sunray_main #    Sunray.pause #  end #end Sunray = SG_Sunray.new
[/cut]

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Время создания страницы: 0.087 секунд
Работает на Kunena форум