~ubuntu-branches/ubuntu/utopic/frogatto-data/utopic

« back to all changes in this revision

Viewing changes to data/object_prototypes/buyable_item.cfg

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2010-07-16 12:14:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100716121411-tobhfbyxrrz46dwz
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
[prototype]
 
2
zorder=-5
 
3
 
 
4
        [properties]
 
5
        number_owned="size(filter(level.player.vars.items_owned, 'item', item = type))"
 
6
        final_price="consts.price * (1 + number_owned)"
 
7
        [/properties]
 
8
 
 
9
        [consts]
 
10
        max_owned=1
 
11
        [/consts]
 
12
 
 
13
        on_create="[if(number_owned >= consts.max_owned, die())]"
 
14
 
 
15
        on_interact="[fire_event(level.player, 'start_interact')]"
 
16
        on_talk="[set(level.player.time_in_animation_delta, 0),
 
17
                 if(level.player.vars.coins < final_price,
 
18
                    [
 
19
                     speech_dialog(self, consts.description + [~The price is ~ + final_price + ~ coins.~, ~You don't have enough money.~]),
 
20
                                ],
 
21
                                [
 
22
                                 speech_dialog(self, consts.description + [~The price is ~ + final_price + ~ coins.~]),
 
23
                                 speech_dialog(self, [~Do you want to buy the ~ + consts.name + ~?~,
 
24
                                  'Yes', [fire_event('bought'), die(), set(level.player.vars.items_owned, level.player.vars.items_owned + [type]), set(level.player.vars.coins, level.player.vars.coins - final_price)],
 
25
                                  'No', []])
 
26
                                ]),
 
27
                            set(level.player.time_in_animation_delta, 1)]"
 
28
 
 
29
        on_end_normal_anim="animation('normal')"
 
30
        [animation]
 
31
        id=normal
 
32
        interact_area=all
 
33
        [/animation]
 
34
 
 
35
[/prototype]