Changeset 483:b48c194c4af9


Ignore:
Timestamp:
04/09/11 20:05:27 (12 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Some haiku and encoding fixes.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • data/game.json

    r481 r483  
    3232        "kanedas_agreement_disrupted": false,
    3333        "final_battle_lost": false,
    34         "final_battle_won": false
     34        "final_battle_won": false,
     35        "haiku_wins": 0,
     36        "haiku_losses": 0
    3537    },
    3638    "items": {
     
    5052        "no_mask": { "type": "NoMask", "level": "theatre", "pos": [10, 10], "broken": false },
    5153        "no_costume": { "type": "NoCostume", "level": "theatre", "pos": [13, 10] },
    52         "haiku1": { "type": "HaikuScroll", "level": "temple", "pos": [14, 16], "text": "Remaining in it?" },
    53         "haiku2": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "The end of autumn." },
    54         "haiku3": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "With no leaves to blow." },
    55         "haiku4": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "And it passes by." },
    56         "haiku5": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "The Galaxy." },
     54        "haiku1": { "type": "HaikuScroll", "level": "temple", "pos": [14, 16], "text": "remaining in it?" },
     55        "haiku2": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "the end of autumn." },
     56        "haiku3": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "with no leaves to blow." },
     57        "haiku4": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "and it passes by." },
     58        "haiku5": { "type": "HaikuScroll", "level": "_limbo", "pos": [0, 0], "text": "the Galaxy." },
    5759        "aburage_00": { "type": "Aburage", "level": "temple", "pos": [18, 5] },
    5860        "aburage_01": { "type": "Aburage", "level": "temple", "pos": [1, 15] },
  • data/npcs/kitsune.json

    r294 r483  
    11{
    22    "start" : {
    3         "on_entry" : "world.haiku_losses = 0; world.haiku_wins = 0",
     3        "on_entry" : "world.missions.haiku_losses = 0; world.missions.haiku_wins = 0",
    44        "text" : "I’ve been watching you for a time but I never thought you would get this far! You have been very wily and devious.",
    55        "auto_next": "state.onlyone"
     
    6161    },
    6262    "haiku_right" : {
    63         "on_entry" : "world.haiku_wins += 1",
     63        "on_entry" : "world.missions.haiku_wins += 1",
    6464        "events" : [
    65             { "matches" : "world.haiku_wins == 1 and world.haiku_losses == 0", "next": "state.haiku_1win_0loss" },
    66             { "matches" : "world.haiku_wins == 1 and world.haiku_losses == 1", "next": "state.haiku_1win_1loss" },
    67             { "matches" : "world.haiku_wins == 2", "next": "state.haiku_2wins" }
     65            { "matches" : "world.missions.haiku_wins == 1 and world.missions.haiku_losses == 0", "next": "state.haiku_1win_0loss" },
     66            { "matches" : "world.missions.haiku_wins == 1 and world.missions.haiku_losses == 1", "next": "state.haiku_1win_1loss" },
     67            { "matches" : "world.missions.haiku_wins == 2", "next": "state.haiku_2wins" }
    6868        ]
    6969    },
     
    8181    },
    8282    "haiku_wrong" : {
    83         "on_entry" : "world.haiku_losses += 1",
     83        "on_entry" : "world.missions.haiku_losses += 1",
    8484        "text" : "Ha, that’s wrong! One point to me.",
    8585        "events" : [
    86             { "matches" : "world.haiku_losses == 1 and world.haiku_wins == 0", "next": "state.haiku2" },
    87             { "matches" : "world.haiku_losses == 1 and world.haiku_wins == 1", "next": "state.haiku3" },
    88             { "matches" : "world.haiku_losses == 2", "next": "state.lost" }
     86            { "matches" : "world.missions.haiku_losses == 1 and world.missions.haiku_wins == 0", "next": "state.haiku2" },
     87            { "matches" : "world.missions.haiku_losses == 1 and world.missions.haiku_wins == 1", "next": "state.haiku3" },
     88            { "matches" : "world.missions.haiku_losses == 2", "next": "state.lost" }
    8989        ]
    9090    },
  • scripts/npc-test

    r476 r483  
    3535    while True:
    3636        state = dsm.get_state()
    37         print "%s:" % dsm.state, state.text
     37        text = state.text
     38        if text is not None:
     39            text = text.encode('utf-8')
     40        print "%s:" % dsm.state, text
    3841        print "--"
    3942        for i, choice in state.choices:
    4043            print "%d: %s" % (i, choice)
    41         print "L: Leave"
     44        if state.auto_next:
     45            print "N: Next"
     46        else:
     47            print "L: Leave"
    4248        print "--"
    4349
     
    4652        if key == "L":
    4753            break
     54        if key == "N":
     55            dsm.auto_next()
    4856        elif key.isdigit():
    4957            dsm.choice(int(key))
  • skaapsteker/dialogue.py

    r476 r483  
    2323        self._me = getattr(self.world.npcs, name)
    2424        self.states = AttrDict()
    25         src = json.loads(data.load(json_filename).read())
     25        src = json.loads(data.load(json_filename).read(), encoding='utf-8')
    2626        for state, state_src in src.iteritems():
    2727            pseudo_path = [json_filename, state]
  • skaapsteker/gamestate.py

    r479 r483  
    4747            game_file = self._game_file
    4848        raw_data = open(game_file, "rb").read()
    49         self.data = json.loads(raw_data)
     49        self.data = json.loads(raw_data, encoding='utf-8')
    5050        self.world = StateProxy(self.data)
    5151
Note: See TracChangeset for help on using the changeset viewer.