Valentino Posted September 15, 2010 Share Posted September 15, 2010 (edited) Elemosina_System Descrizione Questo script crea un abilità che permette di usare i soldi per danneggiare i nemici, più soldi verranno usati più grande sarà il danno... È possibile costumizzare il rapporto tra soldi usati e danno. Autore Avon Valentino (Io) AllegatiScreenshots:http://img830.imageshack.us/img830/9158/battleelemosina.pnghttp://img826.imageshack.us/img826/2828/battleelemosina2.pngDemo Link:http://www.mediafire.com/download.php?h5dx8cgfv3g241cScript: #-----------------------------Elemosina System--------------------------------- #Questo script crea una abilità che dannegga i nemici in base a quanti soldi #gli si lanciano addosso. #Script creato da Valentino Avon, se lo usate creditatemi ;) #-----------------------------CONFIGURAZIONE----------------------------------- #id della skill elemosina ELEMOSINA_ID = 81 #il danno viene calcolato dividendo i soldi usati per questo numero ELEM_DIVISORE = 10 WIN_X = 0 #cordinata x della window elemosina WIN_Y = 0 #cordinata y della window elemosina #--------------------------------------------------------------------------- class Window_Elemosina < Window_Base attr_accessor :elemosina def initialize @elemosina = 0 super(WIN_X, WIN_Y, 180, 120) @digits_max = 7 @number = 0 dummy_bitmap = Bitmap.new(32, 32) cx = dummy_bitmap.text_size($data_system.words.gold).width self.width = 180 + cx @cursor_width = dummy_bitmap.text_size("0").width + 8 dummy_bitmap.dispose self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 @index = 0 refresh update_cursor_rect end def number return @number end def number=(number) @number = [[number, 0].max, 10 ** @digits_max - 1].min refresh end def update_cursor_rect self.cursor_rect.set(@index * @cursor_width, 60, @cursor_width, 32) end def update super if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) $game_system.se_play($data_system.cursor_se) place = 10 ** (@digits_max - 1 - @index) n = @number / place % 10 @backup = @number @number -= n * place n = (n + 1) % 10 if Input.repeat?(Input::UP) n = (n + 9) % 10 if Input.repeat?(Input::DOWN) @number += n * place if @number <= $game_party.gold @elemosina = @number else @number = @backup end refresh end if Input.repeat?(Input::RIGHT) if @digits_max >= 2 $game_system.se_play($data_system.cursor_se) @index = (@index + 1) % @digits_max end end if Input.repeat?(Input::LEFT) if @digits_max >= 2 $game_system.se_play($data_system.cursor_se) @index = (@index + @digits_max - 1) % @digits_max end end update_cursor_rect end def refresh self.contents.clear self.contents.draw_text(0,0,640,32,$data_system.words.gold + " attuali: " + $game_party.gold.to_s,0) self.contents.draw_text(0,30,640,32,$data_system.words.gold + " da spendere:",0) self.contents.font.color = normal_color s = sprintf("%0*d", @digits_max, @number) for i in 0...@digits_max self.contents.draw_text(i * @cursor_width + 4, 60, 32, 32, s[i,1]) end end end class Game_Actor < Game_Battler attr_accessor :soldi_usati alias elem_setup setup def setup(actor_id) @soldi_usati = 0 elem_setup(actor_id) end end class Scene_Battle alias elemosina_update update def update @elemosina.update if $elemosina elemosina_update end def update_phase3 unless $elemosina if @enemy_arrow != nil update_phase3_enemy_select elsif @actor_arrow != nil update_phase3_actor_select elsif @skill_window != nil update_phase3_skill_select elsif @item_window != nil update_phase3_item_select elsif @actor_command_window.active update_phase3_basic_command end else update_elemosina end end alias elemosina_skill_select update_phase3_skill_select def update_phase3_skill_select elemosina_skill_select if Input.trigger?(Input::C) if @skill.id == ELEMOSINA_ID start_elemosina end end end def start_elemosina if @enemy_arrow != nil @enemy_arrow.dispose @enemy_arrow = nil end @help_window.visible = false @elemosina = Window_Elemosina.new $elemosina = true $elemosina_skill = false @active_battler.soldi_usati = 0 @actor_command_window.active = false @actor_command_window.visible = false end def end_elemosina if @enemy_arrow != nil @enemy_arrow.dispose @enemy_arrow = nil end @skill_window.visible = true @skill_window.active = true @skill_window.help_window = @help_window @elemosina.visible = false $elemosina = false $elemosina_skill = false @active_battler.soldi_usati = 0 end def update_elemosina if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) end_elemosina return end if Input.trigger?(Input::C) if @elemosina.elemosina > 0 $game_system.se_play($data_system.decision_se) enemy_elemosina_select else $game_system.se_play($data_system.buzzer_se) end end end def enemy_elemosina_select @elemosina.visible = false $elemosina = false $elemosina_skill = true @active_battler.soldi_usati = @elemosina.elemosina @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1) @enemy_arrow.help_window = @help_window @skill_window.active = false @skill_window.visible = false end alias elemosina_phase3 update_phase3_enemy_select def update_phase3_enemy_select if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) end_enemy_select unless $elemosina_skill start_elemosina if $elemosina_skill return end elemosina_phase3 end end class Game_Battler alias elemosina_skill skill_effect def skill_effect(user, skill) elemosina_skill(user, skill) if skill.id == ELEMOSINA_ID @soldi = $game_party.gold @soldi -= user.soldi_usati if @soldi < 0 self.damage = (user.soldi_usati + @soldi) /ELEM_DIVISORE $game_party.lose_gold($game_party.gold) else self.damage = (user.soldi_usati/ELEM_DIVISORE) $game_party.lose_gold(user.soldi_usati) end user.soldi_usati = 0 self.hp -= self.damage end end end Istruzioni per l'uso Per non mostrare l'uso di Sp nella finestra delle abilità in battaglia se la skill ha 0 come costo in Sp, copiare la riga evidenziata nella Window_Skill della demo. Per il resto trovate tutto all'interno dello script, se lo usate creditatemi per favore Bugs e Conflitti Noti N/A Edited April 27, 2013 by Dilos Script monoriga sistemato. Targhette Rpg2s:http://img14.imageshack.us/img14/5421/contestsecondo.png Partecipante al Rpg2s.net Game Contest #3http://www.rpg2s.net/images/gc3/gc3_firma.pngGioco in Sviluppo: DREAMS http://img16.imageshack.us/img16/2121/dreamstitle2.png SKY's CRY!http://www.rpg2s.net...showtopic=12557 Lista di script creati da me: Support System FF9 Multiscope System Advanced Armor System Protection System Trance System FF2 Development System Scene Vittoria Animato Aperion System Elemosina System Valentino's Scene Shop Item Plus System Panorama Acceleration System Conversione da VX a XP, Vehicle System Sentinel System Scene Zoolab Valentino's Random System Oggetti Riutilizzabili Break Pictures Limit Gameover Animato Valentino's Gun Mode Valentino's Ally System Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now