Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # Hecho por Elena/Slaqueen
- #==============================================================================#
- # Incluir esto en Scene_Map para lanzar bolas de fuego pulsando la tecla M:
- #
- # if Input.triggerex?(0x4D)
- # lanzarbolafuego
- # end
- #
- # En Game_Character, sustituir attr_reader :opacity por
- # attr_accessor :opacity
- #
- #==============================================================================#
- #Puntos por modularidad
- #Puntos por identar y comentar
- PROYECTIL = "BolaFuego" #Nombre del evento que hace de proyectil
- OBJETIVO = "Objetivo" #Nombre de los eventos objetivos
- ESCOGERINTERRUPTOR = "A" #Interruptor local que se activa cuando el proyectil
- # hace contacto con el evento objetivo
- def lanzarbolafuego
- #Lo cambiaría por un while
- for event in $game_map.events.values
- if event.name == PROYECTIL
- eventofuego = $game_map.events[event.id]
- eventofuego.opacity = 255
- pbSEPlay("Fire1")
- eventofuego.moveto($game_player.x, $game_player.y)
- eventofuego.move_speed = 6
- #Bien usado
- if $game_player.direction == 2
- eventofuego.turn_down
- elsif $game_player.direction == 6
- eventofuego.turn_right
- elsif $game_player.direction == 4
- eventofuego.turn_left
- elsif $game_player.direction == 8
- eventofuego.turn_up
- end
- end
- end
- #Lo cambiaría por un while en caso de que ya haya impactado contra algo
- 9.times do
- eventofuego.move_forward
- for event in $game_map.events.values
- if event.name == OBJETIVO && (eventofuego.x == event.x) && (eventofuego.y == event.y)
- eventofuego.opacity = 0
- $game_self_switches[[$game_map.map_id, event.id, ESCOGERINTERRUPTOR]] = true
- $game_map.refresh
- end
- end
- pbWait(2)
- end
- 5.times do
- eventofuego.opacity -= 51
- pbWait(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement