home *** CD-ROM | disk | FTP | other *** search
/ VIPER Paradice / VIPER.ISO / pc / ENG / SCRIPTS / SPELL.VSC < prev    next >
Encoding:
Text File  |  2002-06-17  |  11.0 KB  |  364 lines

  1. (define (spell-event-cardboard session card)
  2.   (let* ((player    (current-player session))
  3.          (character (current-character player))
  4.          )
  5.     (call-prompt "<p>I've become happy.</p>")
  6.     )
  7.   )
  8.  
  9. (define (spell-event-exchange session card)
  10.   (let* ((player    (current-player session))
  11.          (character (current-character player)))
  12.     (call-caption "<p>Exchange cards</p>")
  13.     (cond 
  14.      ((= 0 (character-spellcards-length character))
  15.       (call-prompt "<p>But you don't have cards to exchange...</p>"))
  16.      ((= 0 (length (other-players session)))
  17.       (call-prompt "<p>But you don't have anyone to exchange with...</p>"))
  18.      (#t
  19.       (let* ((my-card            #f)
  20.              (target-player        #f)
  21.              (target-character    #f)
  22.              (target-card        #f)
  23.              (retry                #t))
  24.         (while
  25.          retry
  26.          (call-message "<p>Pick a card you want to trade</p>")
  27.          (set! my-card
  28.                (character-spellcards-get
  29.                 character
  30.                 (call-query-card character)))
  31.          (call-message "<p>Pick the player you want to trade with</p>")
  32.          (set! target-player
  33.                (session-order-get session (call-query-another-player)))
  34.          (set! target-character
  35.                (player-characters-get target-player 0))
  36.          (if (= 0 (character-spellcards-length target-character))
  37.              (begin
  38.                (call-prompt
  39.                 "<p>"
  40.                 (character-name-get target-character)
  41.                 " She doesn't have a special card......</p>"))
  42.              (begin
  43.                (call-message "<p>Pick a card you want to trade</p>")
  44.                (set! target-card
  45.                      (character-spellcards-get
  46.                       target-character
  47.                       (call-query-card target-character)))
  48.                (call-message "<p>Do you want to trade?</p>")
  49.                (if (call-query-yesno)
  50.                    (begin
  51.                      (character-spellcards-add character target-card)
  52.                      (character-spellcards-add target-character my-card)
  53.                      (character-spellcards-remove target-character target-card)
  54.                      (character-spellcards-remove character my-card)
  55.                      (call-show-spell-card my-card)
  56.                      (call-prompt
  57.                       "<p>"
  58.                       (spell-name-get (call-pull-spell my-card))
  59.                       " is now in "
  60.                       (character-name-get target-character)
  61.                       "'s hands.</p>")
  62.                      (call-show-spell-card target-card)
  63.                      (call-prompt
  64.                       "<p>"
  65.                       (spell-name-get (call-pull-spell target-card))
  66.                       " card now it's in "
  67.                       (character-name-get character)
  68.                       "'s hands!</p>")
  69.                      (call-hide-spell-card)
  70.                      (set! retry #f)))
  71.                ))
  72.          )
  73.         ))
  74.      )
  75.     )
  76.   )
  77.  
  78. (define (spell-event-copy session card)
  79.   (let* ((player    (current-player session))
  80.          (character (current-character player)))
  81.     (call-caption "<p>A copy of the card</p>")
  82.     (cond
  83.      ((= 0 (length (other-players session)))
  84.       (call-prompt "<p>But there is no one you can copy with...</p>"))
  85.      (#t
  86.       (let* ((another    (another-player session))
  87.              (ac        (player-characters-get another 0))
  88.              (count        #f))
  89.         (set! count (character-spellcards-length ac))
  90.  
  91.         ;; æSé─öpèⁿ
  92.         (while (< 0 (character-spellcards-length character))
  93.                (call-remove-spell-card
  94.                 (character-spellcards-get character 0)))
  95.  
  96.         ;; âRâsü[âJü[âhê╚èOé╠âJü[âhé≡é╖é╫é─âRâsü[
  97.         (do ((i 0 (+ 1 i)))
  98.             ((<= count i) #f)
  99.           (let* ((card (character-spellcards-get ac i)))
  100.             (if (not (string=? "âRâsü["
  101.                                (spell-name-get (call-pull-spell card))))
  102.                 (character-spellcards-add
  103.                  character
  104.                  (call-copy-spell-card card)))
  105.             )
  106.           )
  107.         (call-prompt "<p>"
  108.                      (character-name-get ac)
  109.                      " We've copied all the cards!</p>"))))
  110.     )
  111.   )
  112.      
  113. (define (spell-event-move session card)
  114.   (let* ((player    (current-player session))
  115.          (character (current-character player)))
  116.     (cond 
  117.      ((= 0 (length (other-players session)))
  118.       (call-prompt "<p>But you don't have anyone to trade with......</p>"))
  119.      (#t
  120.       (let* ((another    (another-player session))
  121.              (ac        (player-characters-get another 0))
  122.              (line        #f))
  123.         (call-caption "<p> Trading of the bingo line</p>")
  124.         (call-prompt "<p>"
  125.                      (character-name-get ac)
  126.                      " Trade with her.</p>")
  127.         (call-show-left-duelist character)
  128.         (call-show-right-duelist ac)
  129.         (call-exchange-bingo-line ac)
  130.         ))
  131.      )
  132.     )
  133.   )
  134.  
  135. (define (spell-event-duel-aux winner loser)
  136.   (let* ((movie #f))
  137.     (call-prompt "<p>" (character-name-get winner) " You won!</p>")
  138.     (set! movie (move-movie winner loser))
  139.     (if movie
  140.         (begin
  141.           (call-show-movie-card (quotient movie 5)
  142.                                 (remainder movie 5))
  143.           (call-prompt "<p> You subtract her a movie card!</p>")
  144.           (call-hide-movie-card)
  145.           )
  146.         (call-prompt "<p>But " (character-name-get loser)
  147.                      " doesn't have any movie cards......</p>")
  148.         )
  149.     (character-duelwon-apply winner (lambda (x) (+ x 1)))
  150.     (character-duellost-apply loser (lambda (x) (+ x 1)))
  151.     )
  152.   )
  153.  
  154. (define (spell-event-duel session card)
  155.   (let* ((player    (current-player session))
  156.          (character (current-character player))
  157.          (currency-unit    (session-currencyunit-get session)))
  158.     (cond 
  159.      ((= 0 (length (other-players session)))
  160.       (call-prompt "<p>But there is no one to bet with...</p>"))
  161.      (#t
  162.       (let* ((another    (another-player session))
  163.              (ac        (player-characters-get another 0))
  164.              (prize        (* (+ 1 (character-lap-get character)) 50000)))
  165.         (call-show-left-duelist character)
  166.         (call-prompt "<p>Your rival......? </p>")
  167.         (call-show-right-duelist ac)
  168.         (call-prompt "<p>"
  169.                      (character-name-get ac)
  170.                      " It's her!</p>")
  171.         (let* ((winner (call-duel character ac))
  172.                (movie    #f))
  173.           (call-caption "<p>Duel</p>")
  174.           (case winner
  175.             ((0)
  176.              (call-prompt "<p>The duel ended draw.</p>")
  177.              (character-dueldrawn-apply character (lambda (x) (+ x 1)))
  178.              (character-dueldrawn-apply ac (lambda (x) (+ x 1))))
  179.             ((1)
  180.              (set! prize (* 2 prize))
  181.              (call-prompt "<p>"
  182.                           (character-name-get character)
  183.                           " You Won! <br/>"
  184.                           (character-name-get ac)
  185.                           " has to give you "
  186.                           (number->string prize)
  187.                           currency-unit
  188.                           "!</p>")
  189.              (character-money-apply character (lambda (x) (+ x prize)))
  190.              (character-money-apply ac (lambda (x) (- x prize)))
  191.              (call-show-income prize))
  192.             ((2)
  193.              (call-prompt "<p>"
  194.                           (character-name-get character)
  195.                           " You lost.<br/>"
  196.                           (character-name-get ac)
  197.                           " has to get "
  198.                           (number->string prize)
  199.                           currency-unit
  200.                           " from you!</p>")
  201.              (character-money-apply character (lambda (x) (- x prize)))
  202.              (character-money-apply ac (lambda (x) (+ x prize)))
  203.              (call-show-income (- prize)))
  204.             )
  205.           )
  206.         )
  207.       )
  208.      )
  209.     )
  210.   )
  211.  
  212. (define (spell-event-plus1 session card)
  213.   (let* ((player    (current-player session))
  214.          (character (current-character player)))
  215.     (character-skipaction-set character #f)
  216.     (character-walk-set character 1)
  217.     )
  218.   )
  219.  
  220. (define (spell-event-plus2 session card)
  221.   (let* ((player    (current-player session))
  222.          (character (current-character player)))
  223.     (character-skipaction-set character #f)
  224.     (character-walk-set character 2)
  225.     )
  226.   )
  227.  
  228. (define (spell-event-plus3 session card)
  229.   (let* ((player    (current-player session))
  230.          (character (current-character player)))
  231.     (character-skipaction-set character #f)
  232.     (character-walk-set character 3)
  233.     )
  234.   )
  235.  
  236. (define (spell-event-plus4 session card)
  237.   (let* ((player    (current-player session))
  238.          (character (current-character player)))
  239.     (character-skipaction-set character #f)
  240.     (character-walk-set character 4)
  241.     )
  242.   )
  243.  
  244. (define (spell-event-plus5 session card)
  245.   (let* ((player    (current-player session))
  246.          (character (current-character player)))
  247.     (character-skipaction-set character #f)
  248.     (character-walk-set character 5)
  249.     )
  250.   )
  251.  
  252. (define (spell-event-plus6 session card)
  253.   (let* ((player    (current-player session))
  254.          (character (current-character player)))
  255.     (character-skipaction-set character #f)
  256.     (character-walk-set character 6)
  257.     )
  258.   )
  259.  
  260. (define (spell-event-double session card)
  261.   (let* ((player    (current-player session))
  262.          (character (current-character player)))
  263.     (character-skipaction-set character #f)
  264.     (character-walk-set character (call-play-dice 2))
  265.     )
  266.   )
  267.  
  268. (define (spell-event-triple session card)
  269.   (let* ((player    (current-player session))
  270.          (character (current-character player)))
  271.     (character-skipaction-set character #f)
  272.     (character-walk-set character (call-play-dice 3))
  273.     )
  274.   )
  275.  
  276. (define (spell-event-jump session card)
  277.   (let* ((player    (current-player session))
  278.          (character (current-character player))
  279.          (location    (character-location-get character))
  280.          (rank        #f))
  281.     (if (< 1 (node-links-length location))
  282.         ;; ò¬è≥é┼é═âWâââôâvé┼é½é╚éó
  283.         (call-prompt "<p>But you can't jump from here!</p>")
  284.         ;; "jump"(system.vsc)
  285.         (begin
  286.           (set! rank (call-get-rank character #f))
  287.           (call-prompt "<p>"
  288.                        (character-name-get character)
  289.                        " is now in position n. "
  290.                        (number->string (+ rank 1))
  291.                        " in the game, so<br/>she has "
  292.                        (number->string (+ rank 1))
  293.                        " Jump(s) allowed!</p>")
  294.           (jump session (+ rank 1))
  295.           (character-skipaction-set character #f)
  296.           (character-walk-set character 0))
  297.         )
  298.     )
  299.   )
  300.  
  301. (define (spell-event-secret session spell-card)
  302.   (let* ((player    (current-player session))
  303.          (character (current-character player))
  304.          (card        (call-generate-movie-card #f))
  305.          (gold        (car card))
  306.          (silver    (cdr card))
  307.          )
  308.     (call-show-movie-card gold silver)
  309.     (call-prompt "<p>The secret card is <br/>"
  310.                  (call-get-movie-priced-text #f gold silver)
  311.                  "!</p>")
  312.     (call-prompt "<p>But she used it, so it no longer exists. Sorry!</p>")
  313.     (call-hide-movie-card)
  314.     )
  315.   )
  316.  
  317. (define (spell-event-mystery session spell-card)
  318.   (let* ((player    (current-player session))
  319.          (character (current-character player))
  320.          (card        (call-generate-movie-card #f))
  321.          (gold        (car card))
  322.          (silver    (cdr card))
  323.          )
  324.     (call-show-movie-card gold silver)
  325.     (call-prompt "<p>The mistery card is <br/>"
  326.                  (call-get-movie-priced-text #f gold silver)
  327.                  "!</p>")
  328.     (call-prompt "<p>But she used it, so it no longer exists. Sorry!</p>")
  329.     (call-hide-movie-card)
  330.     )
  331.   )
  332.  
  333. (define (spell-event-voice session card)
  334.   (let* ((player    (current-player session))
  335.          (character (current-character player)))
  336.     (character-walkbonus-apply character (lambda (x) (+ x 100)))
  337.     (call-play-se =teleca= #f)
  338.     (call-wait-a-moment 60)
  339.     (call-play-voice (spell-soundpath-get (call-pull-spell card)))
  340.     )
  341.   )
  342.  
  343. (define *spell-events* `(
  344.                          (spell-event-cardboard    .    ,spell-event-cardboard)
  345.                          (spell-event-exchange    .    ,spell-event-exchange)
  346.                          (spell-event-copy       .    ,spell-event-copy)
  347.                          (spell-event-move        .    ,spell-event-move)
  348.                          (spell-event-duel        .    ,spell-event-duel)
  349.                          (spell-event-plus1        .    ,spell-event-plus1)
  350.                          (spell-event-plus2        .    ,spell-event-plus2)
  351.                          (spell-event-plus3        .    ,spell-event-plus3)
  352.                          (spell-event-plus4        .    ,spell-event-plus4)
  353.                          (spell-event-plus5        .    ,spell-event-plus5)
  354.                          (spell-event-plus6        .    ,spell-event-plus6)
  355.                          (spell-event-double    .    ,spell-event-double)
  356.                          (spell-event-triple    .    ,spell-event-triple)
  357.                          (spell-event-jump        .    ,spell-event-jump)
  358.                          (spell-event-voice        .    ,spell-event-voice)
  359.                          (spell-event-secret    .    ,spell-event-secret)
  360.                          (spell-event-mystery    .    ,spell-event-mystery)
  361.                          )
  362.   )
  363.  
  364.