Changeset 338:0da3d9af277f


Ignore:
Timestamp:
Sep 6, 2013, 10:42:18 AM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Message:

Better change sequence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r336 r338  
    3737
    3838
     39def _make_change_sequence(old, new):
     40    return (
     41        new, new, old, old, old, old,
     42        new, new, old, old, old,
     43        new, new, old, old,
     44        new, new, new, old, old,
     45        new, new, new, new, old, old,
     46        new)
     47
     48
    3949class Protagonist(GameObject):
    4050    """Representation of our fearless protagonist.
     
    4858    CHANGING_SEQUENCE = {
    4959        # The key is the form we're changing *from*.
    50         HUMAN_FORM: (
    51             WOLF_FORM, HUMAN_FORM, HUMAN_FORM,
    52             WOLF_FORM, HUMAN_FORM, WOLF_FORM,
    53             HUMAN_FORM, WOLF_FORM, HUMAN_FORM,
    54             WOLF_FORM, HUMAN_FORM, WOLF_FORM,
    55             HUMAN_FORM, WOLF_FORM, WOLF_FORM,
    56         ),
    57         WOLF_FORM: (
    58             HUMAN_FORM, WOLF_FORM, WOLF_FORM,
    59             HUMAN_FORM, WOLF_FORM, HUMAN_FORM,
    60             WOLF_FORM, HUMAN_FORM, WOLF_FORM,
    61             HUMAN_FORM, WOLF_FORM, HUMAN_FORM,
    62             WOLF_FORM, HUMAN_FORM, HUMAN_FORM,
    63         ),
     60        HUMAN_FORM: _make_change_sequence(HUMAN_FORM, WOLF_FORM),
     61        WOLF_FORM: _make_change_sequence(WOLF_FORM, HUMAN_FORM),
    6462    }
    6563
     
    253251
    254252    def toggle_form(self):
    255         for form in self.CHANGING_SEQUENCE[self.form]:
    256             self.changing_sequence.extend([form] * 3)
     253        self.changing_sequence.extend(self.CHANGING_SEQUENCE[self.form])
    257254
    258255    def _go_to_next_form(self):
Note: See TracChangeset for help on using the changeset viewer.