!% +language_name=Italian !% -~S !!% -D ! ------------------------------------------ ! Villa Morgana ! Avventura Testuale dimostrativa realizzata da Paolo Lucchesi ! Questo prodotto e' libero, rilasciato sotto licenza GPL (Gnu Public License), ! riportata nel file allegato gpl.txt. ! Questo prodotto e' distribuito senza alcuna garanzia. L'autore non puo' essere ! ritenuto responsabile per qualsiasi danno dovuto direttamente o indirettamente ! all'uso del prodotto. ! ------------------------------------------ ! File principale ! ------------------------------------------ Constant Story "Villa Morgana"; Constant Headline "^Una dimostrazione interattiva di Paolo Lucchesi^ (Scrivi INFO per istruzioni e informazioni)^"; Release 3; !Constant NOSOUND; Constant MAX_SCORE 7; Constant NUMBER_TASKS 7; Constant TASKS_PROVIDED; Array task_scores -> 1 1 1 1 1 1 1; !Constant CUSTOM_INITGLKWINDOW; #IfDef TARGET_GLULX; Constant SGWHEIGHT 220; Constant SCBACK $E0D8C8; Constant SCTEXT $3D3020; Constant SCSOFT $776644; Constant SCEMPH $2D2010; Constant SCHEAD $4D4030; Constant SCINPU $603020; #EndIf; ! ------------------------------------------ ! Globali ! ------------------------------------------ ! ------------------------------------------ ! Messaggi di libreria ! ------------------------------------------ Replace LMode3Sub; Include "Parser"; Include "sgw"; Object LibraryMessages with before [; Burn: "Ci sentiamo piromani, oggi?"; Dig: "Tempo perso."; Examine: if (lm_n == 1) "Nell'oscurit@`a non riesci a vedere nulla."; Listen: "Un silenzio assoluto e angosciante."; Pray: "Buona idea. Pregare pu@`o darti coraggio."; Sing: "Intoni a bassa voce un motivetto sentito alla radio."; Sleep: "Hai altro da fare. Non puoi metterti a dormire."; Wake: "Non stai dormendo."; Strong, Mild: "Non hai bisogno di essere offensivo."; Swim: "Ben poca acqua qui..."; ]; !Include "writelist"; #IfDef TARGET_GLULX; Include "Infglk"; #Endif; Include "Verblib"; Constant INCLUDE_SWITCHOPTION; Include "DMenus_it"; Include "replace"; Include "tutorobj"; Include ">villa.bli"; ! ------------------------------------------ ! Classi e Attributi ! ------------------------------------------ Attribute readable; Class Room has light; Class DarkRoom ! Nota: questa classe puo' essere usata solo per stanze buie circondate da ! altre stanze buie, visto che non controlla le locazioni adiacenti with before [; Go: if (~~OffersLight(self)) "Non puoi muoverti nell'oscurit@`a completa."; ]; Class Prop with before [; Examine: rfalse; Search: <>; default: if (self provides cant_go) { self.cant_go(); rtrue; } ], has scenery; Class Porta with description [; self.printstatus(); ], printstatus [; if (self has open) print_ret (The)self, " @`e apert", (genderandnumber)self, "."; else print_ret (The)self, " @`e chius", (genderandnumber)self, "."; ], before [; Enter: if (self hasnt open) { self.printstatus(); rtrue; } Lock: give self ~open; Knock: if (self has open) print_ret "Inutile bussare, @`e apert", (genderandnumber)self, "."; "Nessuna risposta."; ], after [; Unlock: give self open; ], react_before [; Go: if (noun.door_dir == self.door_dir()) <>; ], has scenery door openable; ! ------------------------------------------ ! Variabili e Oggetti particolari ! ------------------------------------------ Global conversor = 0; Object allpurpose_daemon with daemon [; if (conversor) if (~~TestScope(conversor)) conversor=0; if (location == TheDark) { ViewPicture(Buio_img); DoTutor(self, "Devi trovare il modo di far luce. Dovresti aver trovato una candela e un accendino (altrimenti torna a cercarli). Scrivi ACCENDI LA CANDELA."); } else if (location hasnt light) give self tutored; ]; Object pareti "pareti" with name 'pareti' 'parete' 'muri' 'mura' 'muro', found_in [; rtrue;], has scenery female pluralname; Object roccia "roccia" with name 'roccia' 'pietra', found_in galleria1 bivio davanticella cella antro, has scenery female; !Object darkimage "darkness" thedark ! with describe [; ViewPicture(Buio_img); rtrue; ]; ! ------------------------------------------ ! Include e Procedure ! ------------------------------------------ ! Glulx routines #IfDef TARGET_GLULX; Global pictureflag = true; [ DrawPicture ix fl; if (~~pictureflag) rfalse; if (~~glk_gestalt(gestalt_Graphics)) rfalse; if (fl) glk_image_draw(gg_mainwin, ix, imagealign_MarginLeft, 0); else glk_image_draw(gg_mainwin, ix, imagealign_InlineUp, 0); ""; ]; Global actualpic=0; [ ViewPicture ix; !if (~~pictureflag) rfalse; if (actualpic == ix) rfalse; actualpic = ix; viewImageCenter(ix, 426); ]; [ BreakFlow; glk_window_flow_break(gg_mainwin); ]; !Constant SGWHEIGHT 240; !Constant SCBACK $E0DDD3; !Constant SCTEXT $4D4030; !Constant SCSOFT $776644; !Constant SCEMPH $2D2010; !Constant SCHEAD $3D3020; !Constant SCINPU $603020; ! ![ initglkwindow winrock; ! switch (winrock) { ! gg_mainwin_rock, gg_statuswin_rock: ! glk_stylehint_set(wintype_alltypes, style_normal, stylehint_textcolor, sctext); ! glk_stylehint_set(wintype_alltypes, style_normal, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_normal, stylehint_justification, stylehint_just_leftright); ! glk_stylehint_set(wintype_alltypes, style_emphasized, stylehint_textcolor, scemph); ! glk_stylehint_set(wintype_alltypes, style_emphasized, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_header, stylehint_textcolor, scemph); ! glk_stylehint_set(wintype_alltypes, style_header, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_subheader, stylehint_textcolor, schead); ! glk_stylehint_set(wintype_alltypes, style_subheader, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_alert, stylehint_textcolor, scinpu); ! glk_stylehint_set(wintype_alltypes, style_alert, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_note, stylehint_textcolor, scinpu); ! glk_stylehint_set(wintype_alltypes, style_note, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_blockquote, stylehint_textcolor, scinpu); ! glk_stylehint_set(wintype_alltypes, style_blockquote, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_input, stylehint_textcolor, scinpu); ! glk_stylehint_set(wintype_alltypes, style_input, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_preformatted, stylehint_textcolor, scinpu); ! glk_stylehint_set(wintype_alltypes, style_preformatted, stylehint_backcolor, scback); ! glk_stylehint_set(wintype_alltypes, style_user1, stylehint_textcolor, scsoft); ! glk_stylehint_set(wintype_alltypes, style_user1, stylehint_backcolor, scback); ! } ! rfalse; ! ]; #EndIf; Stub ViewPicture 1; Stub DrawPicture 1; Stub BreakFlow 0; ! Includes Include ">villafl1.inf"; ! Gioco, primo piano Include ">villafl2.inf"; ! Gioco, secondo piano Include ">villafl3.inf"; ! Gioco, sotterranei Include ">villamen.inf"; ! Sistema di menu' ! Entry point routines [ DarkToDark; "@`E pericoloso procedere nell'oscuri@`a completa...^"; ]; [ LookRoutine; if (location == thedark) ViewPicture(Buio_img); ]; ! [ DeathMessage; ! if (deadflag==3) print "Il tuo."; ! else print "FINE"; ! ]; [ PrintTaskName ach; ! Obbiettivi switch(ach) { 0: "Hai trovato la collana"; 1: "Hai trovato la chiave"; 2: "Hai preso la candela"; 3: "Hai aperto il passaggio nello studio"; 4: "Hai ritrovato Valeria"; 5: "Hai ottenuto l'anello"; 6: "Hai sconfitto la strega"; } ]; [ WaitKey; #IfDef TARGET_GLULX; glk_set_style(style_User1); print " [ . . . ] ^"; glk_set_style(style_Normal); #IfNot; print " . . . ^"; #EndIf; KeyCharPrimitive(); ]; [ Owned x y; while (x) { x = parent(x); if (x == y) rtrue; } rfalse; ]; [ ChooseObjects obj code r; if (code < 2) if (obj has scenery or static or animate or concealed) return 2; if (code == 0) { if (parent(obj) && parent(obj) has supporter) return 1; if (parent(obj) && parent(obj) has container && player in parent(obj)) return 1; } if (code == 2) { if (obj in compass) r=1; if (obj has scenery) r=3; if (obj has pluralname) r=4; r = 5; if (action_to_be == ##Take or ##Insert or ##PutOn or ##TakeWith && (~~owned(obj, player))) r = r + 3; return r; } rfalse; ]; [ mydescription; if (cappotto in player && cappotto has worn) "Sembreresti il classico investigatore privato di un film giallo, ma il cappotto di Valeria rovina tutto l'effetto e ti rende abbastanza ridicolo."; "Sembri il classico investigatore privato di un film giallo, e devi ammettere che la cosa non ti dispiace."; ]; [Initialise; !initializeSGW(250); print "Faticosamente riprendi i sensi...il freddo pavimento sotto il tuo volto.^ Cerchi di ricordare cosa ti ha condotto fino a l@`i: lo squillo del telefono, la tua amica Valeria che si rifaceva viva - praticamente non la sentivi da sei mesi - chiedendoti di raggiungerla nella sua futura residenza, un vecchio palazzo chiamato Villa Morgana; voleva mostrarti una cosa interessante - diceva lei - ma il tono nervoso della sua voce ti aveva messo in allarme.^"; print "Poi il viaggio, la tua auto che si fermava davanti al cancello della villa, nessuna risposta al tuo bussare; il portone era stranamente aperto. Sei entrato, preoccupato per Valeria, muovendo i tuoi passi lungo il corridoio e le stanze vicine, cercandola e chiamandola.^ Di colpo tutto intorno a te ha iniziato a girare e il buio ti ha avvolto.^^"; print "Ti risvegli, lasci che i tuoi occhi si abituino alla poca luce che filtra in qualche modo all'interno e ti guardi attorno. Polvere, finestre murate, pareti e mobilio in rovina. Sei sempre all'interno della Villa. Ma la Villa in qualche modo @`e cambiata.^^"; viewPicture(Intro_img); WaitKey(); #IfnDef NOSOUND; setplayMusic(Mansion_snd); #EndIf; !player.description="Sembri il classico investigatore privato di un film giallo, e devi ammettere che la cosa non ti dispiace."; player.description=mydescription; StartDaemon(allpurpose_daemon); lookmode=2; location = salotto; banner(); ! #Ifndef DEBUG; ! print "Vuoi caricare una partita salvata? > "; ! if (yesorno()) ; ! #Endif; return 2; ]; !Global ScenicFlag=4; !Include "scenici.h"; [ Handle_SCENERY_PE; ! Per un errore di SCENERY (usare una parola della proprieta' NAME ! della stanza) dovuto ad un'operazione di tipo EXAMINE, mostra la ! descrizione della stanza. if (action_to_be == ##Examine or ##Search or ##Consult) { if (location.describe ~= NULL) RunRoutines(location, describe); else { if (location.description == 0) RunTimeError(11, location); else PrintOrRun(location, description); } InformLibrary.end_turn_sequence(); rtrue; } rfalse; ! Gli errori non sono gestiti. ]; [ ParserError eType; ! Entry point standard, chiamato dalle routine di libreria dopo ! un errore di parsing. if (eType == SCENERY_PE) return Handle_SCENERY_PE(); rfalse; ! Error was NOT handled by this routine. ]; ! Routine dei verbi [ LMode3Sub; "La modalità ~breve~ non è accessibile in questo gioco."; ]; #IfDef TARGET_GLULX; [ ImagesSub; if (pictureflag) { pictureflag = false; SGWCloseWindow(); "[Le immagini sono disattivate.]"; } pictureflag = true; SGWOpenWindow(); "[La immagini sono attivate.]"; ]; #EndIf; [ ExitsSub; if (location provides cant_go) { location.cant_go(); rtrue; } if (location == thedark) "L'oscurit@`a ti impedisce di vedere dove andare."; "Non sembra che da qui ci siano uscite."; ]; [ UntieSub; "Non ne vedo il motivo."; ]; [ ReadSub; <>; ]; [ TakeWithSub; "Non capisco cosa intendi."; ]; [ GoUpSub; <>; ]; [ GoDownSub x; x=parent(player); if (x has supporter) <>; <>; ]; [ SwitchOffWithSub; <>; ]; [ LiftSub; <>; ]; [ KnockSub; "Bussare a cosa?"; ]; [ SlamSub; if (noun has door) <>; <>; ]; [ KeepTalkSub; if (~~conversor) "Non stai parlando con nessuno, adesso."; <>; ]; global xyzzed=false; [ XyzzySub; if (xyzzed) "Non succede niente."; xyzzed = true; "D'improvviso il tempo si ferma, tutto si fa buio, e dal nulla appare un piccolo omuncolo verde che ti dice: @<>. Detto questo l'omuncolo scompare in una nuvola di fumo e tutto torna alla normalit@`a."; ]; [__WarningSquasher x; x = Frontispiece_ib; if (false) __WarningSquasher(x); BreakFlow(); DrawPicture(); ]; Include "ItalianG"; ! ------------------------------------------ ! Estensioni ! ------------------------------------------ Verb meta 'help' 'info' 'informazioni' 'aiuto' 'menu' * -> Help; Verb meta 'configura' 'opzioni' 'conf' * -> Conf; Verb meta 'tutor' 'guida' * -> Tutor; #IfDef TARGET_GLULX; Verb meta 'immagini' 'disegni' 'grafica' * -> Images; #EndIf; Verb meta 'uscite' * -> Exits; Verb 'stacca' 'separa' 'slega' 'sciogli' 'libera' * noun -> Untie; Verb 'alza' 'solleva' * noun -> Lift; Verb 'volta' * noun -> Turn; Verb 'bussa' * 'a'/'all^'/'allo'/'alla'/'al'/'agli'/'ai'/ 'alle' noun -> Knock; Verb 'sbatti' * noun -> Slam; Verb 'topic' 'argomento' 't' * topic -> KeepTalk; Verb 'riposa' = 'dormi'; Verb 'pizzica' = 'tocca'; Verb 'infila' = 'inserisci'; ! Correzione per PushDir e per attacca Extend 'premi' * noun 'verso' noun -> PushDir; Extend 'sposta' * noun 'a'/'ad'/'all^'/'allo'/'alla'/'al'/'agli'/ 'ai'/'alle'/'verso' noun -> PushDir; Extend only 'attacca' * noun 'a'/'ad'/'all^'/'allo'/'alla'/'al'/ 'agli'/'ai'/'alle' noun -> Tie; Extend 'svuota' * noun 'in'/'nel'/'nello'/'nell^'/'nella'/ 'nei'/'negli'/'nelle'/'dentro' noun -> EmptyT * noun 'dentro' 'a'/'ad'/'all^'/'allo'/'alla'/ 'al'/'agli'/'ai'/'alle' noun -> EmptyT; Extend 'prendi' * noun 'con' noun -> TakeWith; Extend 'leggi' first * readable -> Read; Extend 'sali' first * -> GoUp; Extend 'scendi' first * -> GoDown; Extend 'spegni' * noun 'con'/'col' noun -> SwitchOffWith; Verb 'getta' = 'lancia'; Verb meta 'xyzzy' 'plugh' 'plover' * -> Xyzzy;