Jump to content
Rpg²S Forum

-Fishing System


 Share

Recommended Posts

TSL Fishing System

Descrizione

Minigame in cui bisogna fermare il cursore nella parte gialla della barra per poter pescare un oggetto. Se il cursore si ferma nella parte blu non succede nulla se invece si ferma nella parte verde si avvia una battaglia. Quando si centra la parte gialla apparirà un'altra barra la quale dovrà essere riempite premendo continuamente invio, se non si preme invio la barra si svuoterà ed una volta che sarà vuota fallirete la pesca. Facendo salire il livello di pesca diventa più facile riempire la barra.

 

Autore

The Sleeping Leonhart

 

Screenshot

http://img517.imageshack.us/img517/8136/asd2en6.png

http://img517.imageshack.us/img517/7125/asdvh2.png

Allegati

 

 

Script

 

 

#===============================================================================
# TSL Fishing System
#===============================================================================
# The Sleeping Leonhart
# Version 1.2
# 29-7-2007
#===============================================================================
# Lo script è un sistema di pesca da me ideato ed è ancora da finire.
# Per richiamare lo script sulla mappa basta usare il comando 
# Scene_Fishing.new(Velocità cursore,[id gruppo mostri1,id gruppo mostri2,etc],[id ogetto1,id oggetto2,etc..],livello pesce,fuga,morte)
# fuga e morte vanno impostati come true o false. Se fuga è true sarà possile fuggire
# dall'eventuale battaglia con il mostro mentre se morte è true quando si muore nella
# battaglia con il mostro non si fa game over.
# Richiamando lo script verra visualizzata una barra con piu colori e con un trattino
# rosso che si muove. Bene lo scopo del minigioco è di far fermare il trattino
# nella parte gialla della barra. Se il trattino si fermerà nella parte blu non
# succederà niente se invece va a finire in quella verde comparirà un gruppo di mostri.
# Quando la parte gialla viene centrata bisogna premere il tasto invio sino a reimpire la
# nuova barra apparsa, tale compito però non sarà tanto facile perchè mentre voi
# fate salire la barra il pesce la fa abbassare, se la barra si svuota avete fallito
# se invece riuscite a riempirla pescherete l'oggetto.
# La pesca diviene più facile quando il livello pesca sale, tale livello aumenta
# guadagnando esperienza, l'esperienza si guadagna nel seguente modo:
# Barra riempita +1 exp
# Barra svuotata -1 exp
# Incontro con mostro 0 exp
# Cursore sulla barra blu -1 exp
# CONSIGLIO
# L'oggetto pescato o il gruppo di mostri apparso verrà estratto a caso, perciò
# se quando richiamo la scena nell'array dei mostri metto [1,2] avrò il 50% di probabilità
# di pescare uno dei due oggetti mentre se invece dichiaro [1,1,1,1,2] avrò l'80%
# di pescare l'oggetto con id 1 ed il 20% l'oggetto con id 2. Stessa cosa vale per i mostri
#===============================================================================
class Game_System
 attr_accessor :fishing_level
 attr_accessor :fishing_exp
 attr_accessor :completed_fish
 attr_accessor :failed_fish
 alias tsl_fishing_init initialize
 def initialize
@fishing_level = 0
@fishing_exp = 0
@completed_fish = 0
@failed_fish = 0
tsl_fishing_init
 end
end
class Scene_Fishing
 def initialize(bar_speed,monster,item,fish_force,run = false,die = false)
@speed = bar_speed
@monster = monster
@item = item
@level = fish_force
@run = run
@die = die
 end
 def main
@bg = Spriteset_Map.new
@start_x = rand(80)
@w = rand(20)
@bar_window = Fishing_Bar.new(@start_x, @w)
@starting_value = rand(20)+30
@action_window = Fishing_Action.new(@starting_value)
@stat_window = Fishing_Screen.new
@pressing = 0
@action_window.active = @action_window.visible = false
@help_window = Window_Help.new
@help_window.visible = false
@x = 0
Graphics.transition
loop do
  Graphics.update
  Input.update
  update
  if $scene != self
	break
  end
end
@bg.dispose
@bar_window.dispose
@action_window.dispose
@help_window.dispose
@stat_window.dispose
 end
 def update
@bg.update
@help_window.update
@stat_window.update
@bar_window.update(@x)
if @bar_window.active
  fishing
end
if @action_window.active
  fish_fight
end
 end
 def fishing
if @x == 100
  @x = 0
elsif @x < 100
  @x += @speed
else
  @x = 100
end
if Input.trigger?(Input::C)
  case @x
  when 0..@start_x
	lose
  when @start_x+1..@start_x+@w
	$game_party.gain_item(@item[rand(@item.size)],1)
	@action_window.active = @action_window.visible = true
	@bar_window.active = @bar_window.visible = false
  when @start_x+@w+1..100
	@help_window.visible = true
	@help_window.set_text("Mostro in agguato!")
	Audio.se_play("Audio/SE/015-Jump01", 100, 100)
	$game_system.failed_fish += 1
	loop do
	  Input.update
	  Graphics.update
	  if Input.trigger?(Input::C)
		break
	  end
	end
	$game_temp.battle_calling = false
	$game_temp.map_bgm = $game_system.playing_bgm
	$game_system.bgm_stop
	$game_system.se_play($data_system.battle_start_se)
	$game_system.bgm_play($game_system.battle_bgm)
	$game_temp.battle_can_escape = @run
	$game_temp.battle_can_lose = @die
	$game_player.straighten
	$game_temp.battle_troop_id = @monster[rand(@monster.size)]
	$scene = Scene_Battle.new
  end
end
 end
 def fish_fight
if Input.trigger?(Input::C)
  @pressing += 8+$game_system.fishing_level
  if @starting_value+@pressing > 100
	@pressing = 100-@starting_value
  end
else
  @pressing -= 0.5+@level/2
end
@action_window.update(@pressing)
if @starting_value+@pressing >= 100
  win
elsif @starting_value+@pressing <= 0
  lose
end
 end
 def win
@help_window.visible = true
@help_window.set_text("Hai pescato #{$data_items[@item[rand(@item.size)]].name}")
Audio.se_play("Audio/SE/022-Dive02", 100, 150)
$game_system.completed_fish += 1
$game_system.fishing_exp +=1
if $game_system.fishing_exp == 10*($game_system.fishing_level+1)
  $game_system.fishing_level += 1
  $game_system.fishing_exp = 0	  
end
sleep(0.25)
loop do
  Input.update
  Graphics.update
  if Input.trigger?(Input::C)
	break
  end
end
$scene = Scene_Map.new
 end
 def lose
@help_window.visible = true
@help_window.set_text("Hai fallito.")
Audio.se_play("Audio/SE/057-Wrong01", 100, 100)
$game_system.failed_fish += 1
if $game_system.fishing_exp != 0
  $game_system.fishing_exp -=1
end
loop do
  Input.update
  Graphics.update
  if Input.trigger?(Input::C)
	break
  end
end
$scene = Scene_Map.new
 end
end
class Fishing_Bar < Window_Base
 def initialize(x,w)
super(0, 480-64, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@x = x
@w = w
#bordo
self.contents.fill_rect(0, 0, 106, 12, Color.new(0,0,0))
self.contents.fill_rect(1, 1, 104, 10, normal_color)
self.contents.fill_rect(2, 2, 102, 8, Color.new(0,0,0))
self.contents.fill_rect(3, 3, @x, 6, Color.new(0,0,255))
self.contents.fill_rect(3+@x, 3, @w, 6, crisis_color)
self.contents.fill_rect(3+@x+@w, 3, 100-@x-@w, 6, Color.new(0,255,0))
@cursor = Sprite.new
@cursor.y = y + 16
@cursor.z = 102
@cursor.bitmap = RPG::Cache.picture("FS-Cursore.png")
update(0)
 end
 def update(cursor_x)
@cursor.x = 15+cursor_x
 end
 alias tslfs_fb_dispose dispose
 def dispose
tslfs_fb_dispose
@cursor.dispose
 end
end
class Fishing_Action < Window_Base
 def initialize(start)
super(0, 480-64, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@start = start
update(0)
 end
 def update(action)
self.contents.fill_rect(0, 0, 106, 12, Color.new(0,0,0))
self.contents.fill_rect(1, 1, 104, 10, normal_color)
self.contents.fill_rect(2, 2, 102, 8, Color.new(0,0,0))
for i in 0..@start+action
  self.contents.fill_rect(3+i, 3, 1, 6, Color.new(55+i*2,0,0))
end
 end
end
class Fishing_Screen < Window_Base
 def initialize
super(400, 64, 240, 160)
self.contents = Bitmap.new(width - 32, height - 32)
update
 end
 def update
self.contents.clear
self.contents.draw_text(0,0,480,32,"Livello Pesca: #{$game_system.fishing_level}")
self.contents.draw_text(0,32,480,32,"Esperienza: #{$game_system.fishing_exp}/#{($game_system.fishing_level+1)*10}")
self.contents.draw_text(0,64,480,32,"Pesche riuscite: #{$game_system.completed_fish}")
self.contents.draw_text(0,96,480,32,"Pesche fallite: #{$game_system.failed_fish}")
 end
end

 

 

 

Istruzioni per l'uso

# Per richiamare lo script sulla mappa basta usare il comando:

Scene_Fishing.new(Velocità cursore,[id gruppo mostri1,id gruppo mostri2,etc],[id ogetto1,id oggetto2,etc..], forza pesce,fuga,morte)

Mettete questa immagine nella cartella pictures
post-303-1185755125.png

 

Per favore voglio qualche suggerimento per abbelire lo script quindi commentate plz

 

PS:

Siccome è un minigame per il mio gioco che volevo iscrivere al game contest vi chiedo la cortesia di non usarlo in un gioco che partecipa al concorso. Grazie

Edited by Sleeping Leonhart
Link to comment
Share on other sites

roba pazza XD lo provero' presto ^^

Progetti:

Cronache del Mondo Emerso RPGVX -in progettazione-

Captain Tsubasa RPG 1 (Holly e Benji) RPG2k -ultimato-

Captain Tsubasa RPG 2 (Holly e Benji) RPGXP -in lavorazione 10%-

One Piece (All'arrembaggio) RPG2k -interrotto-

The Leggend Of Dragons RPG2k -demo rilasciata-

Arcadia Tactics RPGXP -demo rilasciata-

 

---> Visita il Mio Sito <---

 

Contest: http://rpg2s.net/gif/SCContest3Oct.gif - http://www.rpg2s.net/gif/GC_programmazione3.gif - http://www.rpg2s.net/gif/GC_premio2.gif - http://www.rpg2s.net/awards/bestpixel2.jpg

Link to comment
Share on other sites

Ottimo script, bravo!!!

Targhette
http://www.rpg2s.net/awards/mostpolite2.jpghttp://www.rpg2s.net/awards/mostpresent1.jpghttp://i51.tinypic.com/2mfnpt2.png

 

 

http://www.rpg2s.net/dax_games/r2s_regali5.png

Link to comment
Share on other sites

Bravissimo cmq Sleeping Leonhart!

Ti do' qualche consiglio per abbelirlo...

 

Non so se hai mai giocato alla mia demo Ancient Runes (la trovi nella sez release 2k)...

li avevo creato un minigame (un po buggato e scattoso) un minigame della pesca.

Di diverso aveva (oltre all'impostazione grafica) la modalità di gioco.

Al'inizo appariva una barra simile ala tua dove bisognava beccare il 'centro' per far abboccare il pesce...

poi partiva una gara di premute: l'utente doveva continuamente schiacciare un tatso per far caricare la barra... una volta riempita tutta il pesce veniva preso.

In contemporanea la barra diminuiva in base alla forza del pesce (quindi se uno la riempiva a metà e poi non schiacciava piu nulla quella iniziava a 'scaricarsi').

In pratica una gara di premute tra pesce e giocatore!

http://www.browsergamer.net/banner/190x60/browsergamer.jpg http://www.medioshopping.com/img/medioshopping_logo_mini.png

 

www.havana24.net

Premi vinti

 

 

http://www.rpg2s.net/gif/GC_bestof1.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

http://www.rpg2s.net/gif/GC_musica3.gif http://www.rpg2s.net/gif/GC_effettispeciali1.gif http://www.rpg2s.net/gif/GC_effettispeciali1.gif http://www.rpg2s.net/gif/GC_gameplay2.gif http://www.rpg2s.net/gif/GC_mapping1.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_trama1.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif

 

http://www.rpg2s.net/awards/bestgraphic1.jpg http://www.rpg2s.net/awards/bestmaker1.jpg

http://www.rpg2s.net/awards/bestmapper1.jpg http://www.rpg2s.net/awards/bestprogrammer3.jpg

http://rpg2s.net/gif/SCContest1Oct.gif http://i54.tinypic.com/15cikht.gif http://img42.imageshack.us/img42/3015/terzoposto.png

 

 

Link to comment
Share on other sites

@Havana: Ehm...se leggi sopra(dove c'è il PS) sleeping leonart ha detto esplicitamente che, chi partecipa al game contest non lo può usare:D!!!

Targhette
http://www.rpg2s.net/awards/mostpolite2.jpghttp://www.rpg2s.net/awards/mostpresent1.jpghttp://i51.tinypic.com/2mfnpt2.png

 

 

http://www.rpg2s.net/dax_games/r2s_regali5.png

Link to comment
Share on other sites

Vero... grazie soul, mi era sfuggito!

Ho editato. ^^

 

I miei consigli sono cmq validi! :D

http://www.browsergamer.net/banner/190x60/browsergamer.jpg http://www.medioshopping.com/img/medioshopping_logo_mini.png

 

www.havana24.net

Premi vinti

 

 

http://www.rpg2s.net/gif/GC_bestof1.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

http://www.rpg2s.net/gif/GC_musica3.gif http://www.rpg2s.net/gif/GC_effettispeciali1.gif http://www.rpg2s.net/gif/GC_effettispeciali1.gif http://www.rpg2s.net/gif/GC_gameplay2.gif http://www.rpg2s.net/gif/GC_mapping1.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_trama1.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif http://www.rpg2s.net/gif/GC_premio1.gif

 

http://www.rpg2s.net/awards/bestgraphic1.jpg http://www.rpg2s.net/awards/bestmaker1.jpg

http://www.rpg2s.net/awards/bestmapper1.jpg http://www.rpg2s.net/awards/bestprogrammer3.jpg

http://rpg2s.net/gif/SCContest1Oct.gif http://i54.tinypic.com/15cikht.gif http://img42.imageshack.us/img42/3015/terzoposto.png

 

 

Link to comment
Share on other sites

Grazie per i complimenti ed i suggerimenti ora mi metto al lavoro.

Avevo intenzione di inserire anche dei livelli di apprendimento.

Non so magari quando sta al livello 2 hai più forza per tirare fuori il pesce o un qualcosa di simile, che ne dite?

Link to comment
Share on other sites

Si...niente male come idea, a volte a lungo a dare pescare potrebbe diventare noioso, se aggiungi il livello, sarà più facile che il giocatore abbia voglia di pescare;)!!!

Targhette
http://www.rpg2s.net/awards/mostpolite2.jpghttp://www.rpg2s.net/awards/mostpresent1.jpghttp://i51.tinypic.com/2mfnpt2.png

 

 

http://www.rpg2s.net/dax_games/r2s_regali5.png

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

Scusate se uppo un topic vecchio ma,al codice per richiamare lo script,cosa si deve mettere in velocità cursore?e morte e fuga vanno bne così: morte = false fuga = false ???.gli etc.. si devono levare???e in forza pesce cosa va???

Io ho fatto così : Scene_Fishing.new(3,[2,3],[1,32,33],1) ma non mi parte,dove sbaglio?

Edited by Belxebu
Link to comment
Share on other sites

Il topic non è vecchio, o perlomeno finchè ci sono vi rispondo.

 

Allora in velocità cursore va messo un numero che indica la velocità di movimento del cursore,

al posto di morte o true o false(con true se muori fai game over con false no),al posto di fuga o false o true (true puoi fuggire dalla battaglia con false no), quindi per richiamare la pesca all'interno di uno script o con il comando script degli eventi usa:

$scene = Scene_Fishing.new(Velocità cursore,[gruppo mostri1,etc],[ogetto1,etc..],forza pesce,fuga,morte)

Un esempio:

$scene = Scene_Fishing.new(1,[1,2],[1,5,8], 1,true,false)

 

Non so spiegarmi bene però spero ti sia tutto chiaro ^^

Link to comment
Share on other sites

Allora penso sia quello, io utilizzo la 1.02a, forse la tua versione è quella che usa il codice:

$fontface="Arial"

all'interno del main, se è così penso sia quello il problema.

Link to comment
Share on other sites

Non è prorpio legale che io lo faccia cmq

riga 150 dopo

self.contents.clear

aggiungi

self.contents.font.size = numero grandezza font
self.contents.font.name = "nome font"

Ah ovviamente io non ti ho detto niente ;)

Link to comment
Share on other sites

  • 4 weeks later...

Questo script è fantastico...comunque una cosa che potresti aggiungere a questo script che sicuramnte lo renderebbe perfetto sarebbe quello di poter visionare la canna da pesca, la quale in base a come si trova il giocatore davanti all evento cambia posizione anche la canna.

spero che qst sia possibile farlo.

a meno che qst cosa nn si possa già fare tramite evnto comune

Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...