~ubuntu-branches/ubuntu/trusty/monsterz/trusty

« back to all changes in this revision

Viewing changes to debian/patches/030_startup_screen.patch

  • Committer: Package Import Robot
  • Author(s): Barry deFreese
  • Date: 2013-05-26 21:35:56 UTC
  • Revision ID: package-import@ubuntu.com-20130526213556-0lccjpseo2831301
Tags: 0.7.1-5
* Add startup animation patch. (Closes: #439807).
  - Thanks to A Mennucc for the patch.
* Move existing manpage to section 6. (Closes: #605981).
* Change packaging to dh7 style.
* Add patch to pass CFLAGS to Makefile.
  - Add hardening flags.
* Change to source format 3.0 quilt.
  - Drop quilt build-dep.
* Bump Standards Version to 3.9.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: A Mennucc <mennucc1@debian.org>
 
2
Description: Add startup animation with random monster.
 
3
Index: monsterz-0.7.1/monsterz.py
 
4
===================================================================
 
5
--- monsterz-0.7.1.orig/monsterz.py     2013-05-26 22:22:45.000000000 -0400
 
6
+++ monsterz-0.7.1/monsterz.py  2013-05-26 22:28:08.000000000 -0400
 
7
@@ -17,7 +17,7 @@
 
8
 from random import randint
 
9
 from sys import argv, exit, platform
 
10
 from os.path import join, isdir, isfile, dirname, expanduser
 
11
-from os import write, mkdir
 
12
+from os import write, mkdir, getenv
 
13
 
 
14
 # String constants
 
15
 VERSION = '0.7.1'
 
16
@@ -40,6 +40,16 @@
 
17
 ITEM_METAL = ITEMS + 2
 
18
 ITEM_PUZZLE = ITEMS + 3
 
19
 
 
20
+LANG = getenv('LC_MESSAGES') or getenv('LC_ALL') or getenv('LANG') or ''
 
21
+
 
22
+ITEM_NAMES = ['hairy','cloudy','cyclop','auntie','roswell','horny',
 
23
+              'bluewhale','octopie','ghost']
 
24
+
 
25
+if LANG[:2] == 'it':
 
26
+    ITEM_NAMES=['buffopelo','nuvolastra','ciclope',
 
27
+                'ziantonietta','roswell','cornutazzo',
 
28
+                'balenablu','polipetto','fantasmino']
 
29
+
 
30
 STATUS_MENU = 0
 
31
 STATUS_NEW = 1
 
32
 STATUS_GAME = 2
 
33
@@ -890,6 +900,10 @@
 
34
                 w, h = text.get_rect().size
 
35
                 system.blit(text, (192 - w / 2 - 8, 24 + 288 - h / 2))
 
36
                 system.blit(data.normal[self.lucky], (192 + w / 2, 288))
 
37
+                text = fonter.render(ITEM_NAMES[self.lucky],20)
 
38
+                wn, hn = text.get_rect().size
 
39
+                system.blit(text, (192 + w/2 - wn/2 + ITEM_SIZE/2,
 
40
+                                   24 + 288 + ITEM_SIZE - h/2 - hn/2))
 
41
         elif self.lost_timer != -1:
 
42
             # Draw pieces
 
43
             self.board_draw()
 
44
@@ -1374,6 +1388,33 @@
 
45
                 return True
 
46
         return False
 
47
 
 
48
+    wander_monster=randint(0,ITEMS-1)
 
49
+    wander_x=None
 
50
+    wander_y=0
 
51
+    def wanderer_draw(self):
 
52
+        if self.wander_x==None :
 
53
+            if randint(0,30) == 1 :
 
54
+                self.wander_monster = (self.wander_monster+1)%ITEMS
 
55
+                self.wander_y=randint(20,SCREEN_HEIGHT-ITEM_SIZE-20)
 
56
+                self.wander_x=-ITEM_SIZE
 
57
+            return
 
58
+        if randint(0,10) == 1 :
 
59
+            monster = data.blink[self.wander_monster]
 
60
+        else:
 
61
+            monster = data.normal[self.wander_monster]
 
62
+        system.blit(monster, (self.wander_x, self.wander_y))
 
63
+        system.blit(fonter.render(ITEM_NAMES[self.wander_monster], 
 
64
+                                  30, (250,250,250)),
 
65
+                                  (self.wander_x+ITEM_SIZE, self.wander_y+ITEM_SIZE/2-15))
 
66
+        if self.wander_x < SCREEN_WIDTH/3 or self.wander_x > (SCREEN_WIDTH/3)*2 :
 
67
+            self.wander_x += randint(4,8)
 
68
+            self.wander_y += randint(-2,2)
 
69
+        else:
 
70
+            self.wander_x += 3
 
71
+            self.wander_y += randint(-1,1)
 
72
+        if self.wander_x > SCREEN_WIDTH :
 
73
+            self.wander_x=None
 
74
+
 
75
     msat = [0] * 4
 
76
     marea = None
 
77
     def iterate_menu(self):
 
78
@@ -1403,6 +1444,7 @@
 
79
         # Print logo and menu
 
80
         w, h = data.logo.get_size()
 
81
         system.blit(data.logo, (24 + 192 - w / 2, 24 + 96 - h / 2))
 
82
+        self.wanderer_draw()
 
83
         for x in range(4):
 
84
             if self.msat[x] > 180:
 
85
                 monster = data.surprise[shapes[x]]