Browse Source

fixed segfault, fonts are now stored differently.

master
b3yond 5 years ago
parent
commit
cb3175c229
  1. BIN
      code/augmentations.pyc
  2. 5
      code/editor.py
  3. BIN
      code/editor.pyc
  4. BIN
      code/enemies.pyc
  5. 22
      code/game.py
  6. BIN
      code/game.pyc
  7. BIN
      code/items.pyc
  8. 1653
      missions/cheater!
  9. 1661
      missions/escape
  10. 127
      saves/asdf
  11. 179
      saves/b3yond
  12. 179
      saves/test

BIN
code/augmentations.pyc

5
code/editor.py

@ -690,12 +690,15 @@ def erase_fielddata_entry(room):
def choose_target_enemy(room):
print "0: Abort"
for i in room.fielddata:
print i, room.fielddata[i]
print i + ":", room.fielddata[i]
choice = 0
while choice == 0:
try:
choice = int(raw_input("Which enemy is to be killed? "))
if choice == 0:
return
except ValueError:
print("ERROR: Enter a number.")
choice = 0

BIN
code/editor.pyc

BIN
code/enemies.pyc

22
code/game.py

@ -203,6 +203,10 @@ class Mission(object):
if a == False:
return False
print current
player.bitcoins += self.rewardmoney
player.experience += self.rewardxp
for i in self.rewarditems:
player.inventory.add(i)
return True
def item_owned(self, player):
@ -249,11 +253,18 @@ class Panel(sdl2.ext.Entity):
class TextSprite(sdl2.ext.TextureSprite):
"""
font_cache: Dictionary { (font, fontsize) : TTF_OpenFont(font, fontsize) }
"""
font_cache = {}
def __init__(self, renderer, font=None, text="", fontsize=24,
textcolor=sdl2.pixels.SDL_Color(255, 255, 255),
background=sdl2.pixels.SDL_Color(30, 30, 30), depth=20):
self.renderer = renderer.renderer
self.font = TTF_OpenFont(font, fontsize)
if (font, fontsize) not in self.font_cache:
self.font_cache[(font, fontsize)] = TTF_OpenFont(font, fontsize)
self.font = self.font_cache.get((font, fontsize))
self._text = text
self.fontsize = fontsize
self.fontcolor = textcolor
@ -557,7 +568,7 @@ def create_text(world, renderer, text, x, y, fontsize=24, depth=20,
:param text: string
:param x: integer, position
:param y: integer, position
:return:
:return: Panel object
"""
font = "/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf"
sprite = TextSprite(renderer, font, text, fontsize=fontsize, background=background,
@ -934,6 +945,9 @@ def profile_sdl(m, player):
widgetlist, m = build_profile_sdl(m, player)
m.charwin.process()
break
with open("../saves/" + player.name, mode='w') as file:
pickle.dump(player, file)
m.console.push("Game Saved.")
running = False
break
m.charwin.process()
@ -1200,8 +1214,10 @@ def run_mission(m, player, mission):
:param mission: Mission object
:return: player
"""
print mission.description # debug
while not mission.success_func(player):
player, mission = run_room(m, player, mission)
print player.bitcoins # debug
return player
@ -1216,7 +1232,7 @@ def run_room(m, player, mission):
running = True
while running:
widgetlist = display_fields(m, player, mission)
print "running"
# print "running" # debug
events = sdl2.ext.get_events()
for event in events:
m.uiprocessor.dispatch(m.world, event)

BIN
code/game.pyc

BIN
code/items.pyc

1653
missions/cheater!
File diff suppressed because it is too large
View File

1661
missions/escape
File diff suppressed because it is too large
View File

127
saves/asdf

@ -0,0 +1,127 @@
ccopy_reg
_reconstructor
p0
(c__main__
Vampire
p1
c__builtin__
object
p2
Ntp3
Rp4
(dp5
S'name'
p6
S'asdf'
p7
sS'agi'
p8
I5
sS'level'
p9
I1
sS'int'
p10
I5
sS'augmentations'
p11
(lp12
sS'hp'
p13
I98
sS'gun'
p14
g0
(citems
Gun
p15
g2
Ntp16
Rp17
(dp18
g6
S'No gun'
p19
sS'price'
p20
I0
sS'damage'
p21
I0
sS'grange'
p22
I0
sS'ap'
p23
I0
sS'type'
p24
g14
sS'image'
p25
S''
p26
sbsS'experience'
p27
I0
sS'race'
p28
S'Vampire'
p29
sS'sword'
p30
g0
(citems
Sword
p31
g2
Ntp32
Rp33
(dp34
g6
S'Fist'
p35
sS'silverdamage'
p36
I00
sg24
g30
sg20
I0
sg21
I0
sg23
I50
sS'critical'
p37
F0.0
sS'stun'
p38
F0.3
sg25
g26
sbsS'inventory'
p39
(lp40
sS'str'
p41
I8
sS'max_hp'
p42
I98
sS'bitcoins'
p43
I150
sS'mob'
p44
I5
sS'ic'
p45
I0
sS'id'
p46
I1
sS'con'
p47
I6
sb.

179
saves/b3yond

@ -0,0 +1,179 @@
ccopy_reg
_reconstructor
p0
(c__main__
Vampire
p1
c__builtin__
object
p2
Ntp3
Rp4
(dp5
S'str'
p6
I8
sS'name'
p7
S'b3yond'
p8
sS'agi'
p9
I5
sS'level'
p10
I1
sS'int'
p11
I5
sS'augmentations'
p12
(lp13
sS'hp'
p14
I98
sS'gun'
p15
g0
(citems
Gun
p16
g2
Ntp17
Rp18
(dp19
g7
S'No gun'
p20
sS'price'
p21
I0
sS'damage'
p22
I0
sS'grange'
p23
I0
sS'ap'
p24
I0
sS'type'
p25
S'gun'
p26
sS'image'
p27
S''
p28
sbsS'experience'
p29
I100
sS'race'
p30
S'Vampire'
p31
sS'inventory'
p32
(lp33
g0
(g16
g2
Ntp34
Rp35
(dp36
g7
S'Kalaschnikow'
p37
sg21
I80
sg22
I30
sg23
I10
sg24
I100
sg25
S'gun'
p38
sg27
S'guns/kalaschnikow.gif'
p39
sbag0
(citems
Sword
p40
g2
Ntp41
Rp42
(dp43
g7
S'Mace'
p44
sS'silverdamage'
p45
I00
sg25
S'sword'
p46
sg21
I70
sg22
I70
sg24
I100
sS'critical'
p47
F0.1
sS'stun'
p48
F0.5
sg27
S'swords/mace.gif'
p49
sbasS'sword'
p50
g0
(g40
g2
Ntp51
Rp52
(dp53
g7
S'Fist'
p54
sg45
I00
sg25
S'sword'
p55
sg21
I0
sg22
I0
sg24
I50
sg47
F0.0
sg48
F0.3
sg27
g28
sbsS'max_hp'
p56
I98
sS'mob'
p57
I5
sS'ic'
p58
I0
sS'con'
p59
I6
sS'id'
p60
I1
sS'bitcoins'
p61
I100
sb.

179
saves/test

@ -0,0 +1,179 @@
ccopy_reg
_reconstructor
p0
(c__main__
Golem
p1
c__builtin__
object
p2
Ntp3
Rp4
(dp5
S'str'
p6
I8
sS'name'
p7
S'test'
p8
sS'agi'
p9
I4
sS'level'
p10
I1
sS'int'
p11
I3
sS'augmentations'
p12
(lp13
sS'hp'
p14
I106
sS'gun'
p15
g0
(citems
Gun
p16
g2
Ntp17
Rp18
(dp19
g7
S'No gun'
p20
sS'price'
p21
I0
sS'damage'
p22
I0
sS'grange'
p23
I0
sS'ap'
p24
I0
sS'type'
p25
S'gun'
p26
sS'image'
p27
S''
p28
sbsS'experience'
p29
I0
sS'race'
p30
S'Golem'
p31
sS'inventory'
p32
(lp33
g0
(citems
Sword
p34
g2
Ntp35
Rp36
(dp37
g7
S'Short sword'
p38
sS'silverdamage'
p39
I00
sg25
S'sword'
p40
sg21
I40
sg22
I50
sg24
I90
sS'critical'
p41
F0.3
sS'stun'
p42
F0.0
sg27
S'swords/shortsword.gif'
p43
sbag0
(g16
g2
Ntp44
Rp45
(dp46
g7
S'Kalaschnikow'
p47
sg21
I80
sg22
I30
sg23
I10
sg24
I100
sg25
S'gun'
p48
sg27
S'guns/kalaschnikow.gif'
p49
sbasS'sword'
p50
g0
(g34
g2
Ntp51
Rp52
(dp53
g7
S'Fist'
p54
sg39
I00
sg25
S'sword'
p55
sg21
I0
sg22
I0
sg24
I50
sg41
F0.0
sg42
F0.3
sg27
g28
sbsS'max_hp'
p56
I106
sS'mob'
p57
I4
sS'ic'
p58
I0
sS'con'
p59
I7
sS'id'
p60
I1
sS'bitcoins'
p61
I30
sb.
Loading…
Cancel
Save