Confira o Videos Épicos #45!
2 Respostas   238 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
#=============================================================================##======================# #======================##======================# Flashlight BG #======================##======================# by #======================##======================# Gousenfire #======================##======================# Versão: 1.2 #======================##=============================================================================##=============================================================================## ## Configurações ## ##=============================================================================#module FlashlightModule # Opacidade da imagem da lanterna 0 = Transparente / 255 = Preto Opacity = 180# Switch que mostra que está de noite Switch1 = 100# Nome da imagem na pasta pictures Image = "Lantern"# ID, no database, do item que representa as pilhas Batery = 18# ID, no database, do item que representa a lanterna FlashL = 17# Botão que liga a lanterna Buttom = :L # Aperte F1 ao iniciar o jogo para ver a lista de botoes# Tempo (em frames) para se perder uma pilha Time = 120 # 60 framses = 1 segundo# SE tocada quando ocorre algum erro SEE = "Buzzer1"# SE tocada quando liga a lanterna SET = "Cursor2"# Ficar escuro quando a Switch1 estiver ligada? Dark = true end #=============================================================================## ## Código Fonte ## (Não altere essa parte sem a permissão do criador) ##=============================================================================#class Spriteset_Map include FlashlightModule alias fl_initialize initialize alias fl_update update alias fl_dispose dispose def initialize @laternIMG, @laternIMG.bitmap = Sprite.new, Cache.picture(Image) @laternIMG.z = 998 @laternIMG.opacity = Opacity @laternIMG.visible = false @darkBM, @darkBM.bitmap = Sprite.new @darkBM.bitmap = Bitmap.new(1088,1200) @darkBM.x = 0 @darkBM.y = 0 @darkBM.z = 999 @darkBM.bitmap.fill_rect(@darkBM.bitmap.rect, Color.new(0, 0, 0)) @darkBM.opacity = Opacity @darkBM.visible = false @darkBM.update @lanterOnOrOff = false # variable that controlls if the lantern is on or off @isDark = false # variable that controlls if is dark or not @haveEnoughtBaterys = false # variable that controll if the player have enought baterys to turn on the lantern @haveTheLanter # variable that check if the player has the item Lanter fl_initialize end def update # if the buttun is pressed change the variable to the opisit if Input.trigger?(Buttom) if @lanterOnOrOff @lanterOnOrOff = false Audio.se_play("Audio/SE/" + SET, 70, 100) else if @isDark && @haveEnoughtBaterys && @haveTheLanter @lanterOnOrOff = true Audio.se_play("Audio/SE/" + SET, 70, 100) else Audio.se_play("Audio/SE/" + SEE, 70, 100) end end end if @lanterOnOrOff && (!@isDark || !@haveEnoughtBaterys || !@haveTheLanter) @lanterOnOrOff = false Audio.se_play("Audio/SE/" + SET, 70, 100) end # check if the player has the item lanter in the inventory if $game_party.item_number($data_items[FlashL]) > 0 @haveTheLanter = true else @haveTheLanter = false end # Check if the player has batery in the inventory if $game_party.item_number($data_items[Batery]) > 0 @haveEnoughtBaterys = true else @haveEnoughtBaterys = false end # transform the switch in a variable if $game_switches[Switch1] @isDark = true if Dark if !@lanterOnOrOff dark_the_sky else light_up_yhe_sky end end else @isDark = false if Dark light_up_yhe_sky end end # call the right met if @lanterOnOrOff lanter_is_on else latern_is_off end fl_update # call update end def lanter_is_on @laternIMG.visible = true if Graphics.frame_count % Time == 0 $game_party.lose_item($data_items[Batery], 1) end case $game_player.direction when 2 @laternIMG.angle, @coord = 0, [544, 586] when 8 @laternIMG.angle, @coord = 180, [-544, -565] when 6 @laternIMG.angle, @coord = 90, [576, -522] when 4 @laternIMG.angle, @coord = 270, [-576, 570] end @laternIMG.x = $game_player.screen_x - @coord[0] @laternIMG.y = $game_player.screen_y - @coord[1] @laternIMG.update end def latern_is_off @laternIMG.visible = false @lanterOnOrOff = false @laternIMG.update end def dark_the_sky @darkBM.visible = true @darkBM.update end def light_up_yhe_sky @darkBM.visible = false @darkBM.update end def dispose latern_is_off light_up_yhe_sky fl_dispose endend
#=============================================================================##======================# #======================##======================# Flashlight BG #======================##======================# by #======================##======================# Gousenfire #======================##======================# Versão: 1.2 #======================##=============================================================================##=============================================================================## ## Configurações ## ##=============================================================================#module FlashlightModule # Opacidade da imagem da lanterna 0 = Transparente / 255 = Preto Opacity = 180# Switch que mostra que está de noite Switch1 = 100# Nome da imagem na pasta pictures Image = "Lantern"# ID, no database, do item que representa as pilhas Batery = 18# ID, no database, do item que representa a lanterna FlashL = 17# Botão que liga a lanterna Buttom = :L # Aperte F1 ao iniciar o jogo para ver a lista de botoes# Tempo (em frames) para se perder uma pilha Time = 120 # 60 framses = 1 segundo# SE tocada quando ocorre algum erro SEE = "Buzzer1"# SE tocada quando liga a lanterna SET = "Cursor2"# Ficar escuro quando a Switch1 estiver ligada? Dark = true end #=============================================================================## ## Código Fonte ## (Não altere essa parte sem a permissão do criador) ##=============================================================================#class Spriteset_Map include FlashlightModule alias fl_initialize initialize alias fl_update update alias fl_dispose dispose def initialize @laternIMG, @laternIMG.bitmap = Sprite.new, Cache.picture(Image) @laternIMG.z = 998 @laternIMG.opacity = Opacity @laternIMG.visible = false @darkBM, @darkBM.bitmap = Sprite.new @darkBM.bitmap = Bitmap.new(1088,1200) @darkBM.x = 0 @darkBM.y = 0 @darkBM.z = 999 @darkBM.bitmap.fill_rect(@darkBM.bitmap.rect, Color.new(0, 0, 0)) @darkBM.opacity = Opacity @darkBM.visible = false @darkBM.update @lanterOnOrOff = false # variable that controlls if the lantern is on or off @isDark = false # variable that controlls if is dark or not @haveEnoughtBaterys = false # variable that controll if the player have enought baterys to turn on the lantern @haveTheLanter # variable that check if the player has the item Lanter fl_initialize end def update # if the buttun is pressed change the variable to the opisit if Input.trigger?(Buttom) if @lanterOnOrOff @lanterOnOrOff = false Audio.se_play("Audio/SE/" + SET, 70, 100) else if @isDark && @haveEnoughtBaterys && @haveTheLanter @lanterOnOrOff = true Audio.se_play("Audio/SE/" + SET, 70, 100) else Audio.se_play("Audio/SE/" + SEE, 70, 100) end end end if @lanterOnOrOff && (!@isDark || !@haveEnoughtBaterys || !@haveTheLanter) @lanterOnOrOff = false Audio.se_play("Audio/SE/" + SET, 70, 100) end # check if the player has the item lanter in the inventory if $game_party.item_number($data_items[FlashL]) > 0 @haveTheLanter = true else @haveTheLanter = false end # Check if the player has batery in the inventory if $game_party.item_number($data_items[Batery]) > 0 @haveEnoughtBaterys = true else @haveEnoughtBaterys = false end # transform the switch in a variable if $game_switches[Switch1] @isDark = true if Dark if !@lanterOnOrOff dark_the_sky else light_up_yhe_sky end end else @isDark = false if Dark light_up_yhe_sky end end # call the right met if @lanterOnOrOff lanter_is_on else latern_is_off end fl_update # call update end def lanter_is_on @laternIMG.visible = true if Graphics.frame_count % Time == 0 $game_party.lose_item($data_items[Batery], 1) end case $game_player.direction when 2 @laternIMG.angle, @coord = 0, [544, 586] when 8 @laternIMG.angle, @coord = 180, [-544, -565] when 6 @laternIMG.angle, @coord = 90, [576, -522] when 4 @laternIMG.angle, @coord = 270, [-576, 570] end @laternIMG.x = $game_player.screen_x - @coord[0] @laternIMG.y = $game_player.screen_y - @coord[1] @laternIMG.update end def latern_is_off @laternIMG.visible = false @lanterOnOrOff = false @laternIMG.update end def dark_the_sky @darkBM.visible = true @darkBM.update end def light_up_yhe_sky @darkBM.visible = false @darkBM.update end def dispose #latern_is_off light_up_yhe_sky fl_dispose endend