Skip to content

Commit

Permalink
Reshuffle more terrain properties.
Browse files Browse the repository at this point in the history
Rename 'hasroof' to 'covered'.
Get rid of 'name' (large, useless) and
'top' (duplicates 'covered' now there are two sprites per tile).
  • Loading branch information
Francis Herne committed Jan 11, 2015
1 parent 8b463df commit 04097de
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion MGO/Dragon.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def flameplayer():
self.hunting = None
for player in world.players:
playerpos = player.position
if not self.cellmap[playerpos]['top'] and not self.cellmap[playerpos]['hasroof'] and random.random() < Dragon.speed:
if not self.cellmap[playerpos]['covered'] and random.random() < Dragon.speed:
offset = tileoffset(self.position, playerpos, self.cellmap.size)
if offset[0]**2 + offset[1]**2 <= Dragon.detectionrange**2:
self.hunting = player
Expand Down
2 changes: 1 addition & 1 deletion MGO/GEPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def subtuple(a, b):
oldpos = subtuple(self.position, self.direction)
pathnbrs = []
for nbrpos in coords.neighbours(self.position):
if (nbrpos == oldpos) or (self.cellmap[nbrpos]['name'] not in ['wooden planking', 'paving']):
if (nbrpos == oldpos) or (self.cellmap[nbrpos]['roughness'] > 2):
continue
pathnbrs.append(nbrpos)
if len(pathnbrs) != 1:
Expand Down
4 changes: 1 addition & 3 deletions Map.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,8 @@ def destroy(self, coord):
if not cell['destructable']:
return False
self.damagedtiles[coords.mod(coord, self.size)] = random.choice(images.Damaged)
cell['hasroof'] = False
cell['name'] = "shattered debris"
cell['covered'] = False
cell['collectableitem'] = 0
cell['top'] = False
cell['fireignitechance'] = 0
cell['fireoutchance'] = 1
cell['transparent'] = True
Expand Down
28 changes: 14 additions & 14 deletions map/terrain.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# r g b name top destr tmp ignite out roof trans solid soggy/roughness groundimage topimage
0, 0, 0, wall, False, True, 20, 0, 1, False, False, True, 0, 0, wall,
0, 255, 255, window, False, True, 20, 0, 1, False, True, True, 0, 0, glass,
127, 127, 127, rocky ground, False, True, 20, 0, 1, False, True, False, 0, 60, rock,
255, 255, 255, snow, False, True, -5, 0, 1, False, True, False, 10, 5, snow,
128, 0, 128, floor, False, True, 20, 0.5, 0.05, True, True, False, 0, 0, floor,
0, 255, 0, grass, False, True, 20, 0.1, 0.3, False, True, False, 5, 5, grass,
64, 127, 64, forest, True, True, 20, 0.5, 0.1, False, False, False, 15, 20, grass, trees
127, 127, 0, sand, False, True, 20, 0, 1, False, True, False, 5, 5, sand,
255, 255, 127, paving, False, True, 20, 0, 1, False, True, False, 0, 2, paving,
127, 64, 0, wooden planking, False, True, 20, 0.4, 0.1, False, True, False, 0, 2, planks,
64, 127, 127, marshland, False, True, 20, 0, 1, False, True, False, 60, 10, marsh,
0, 127, 255, water, False, False, 12, 0, 1, False, True, False, 100, 10, water,
0, 0, 255, deep water, False, False, 8, 0, 1, False, True, True, 100, 40, deepwater,
# r g b destr ignite out covered trans solid temp soggy/roughness groundimage topimage
0, 0, 0, True, 0, 1, False, False, True, 20, 0, 0, wall, # Walls
0, 255, 255, True, 0, 1, False, True, True, 20, 0, 0, glass, # Glass
127, 127, 127, True, 0, 1, False, True, False, 20, 0, 60, rock, # Rocks
255, 255, 255, True, 0, 1, False, True, False, -5, 10, 5, snow, # Snow
128, 0, 128, True, 0.5, 0.05, True, True, False, 20, 0, 0, floor, # Indoor tiles
0, 255, 0, True, 0.1, 0.3, False, True, False, 20, 5, 5, grass, # Grass
64, 127, 64, True, 0.5, 0.1, False, False, False, 20, 15, 20, grass, trees # Forest
127, 127, 0, True, 0, 1, False, True, False, 20, 5, 5, sand, # Sand
255, 255, 127, True, 0, 1, False, True, False, 20, 0, 2, paving, # Paving tiles
127, 64, 0, True, 0.4, 0.1, False, True, False, 20, 0, 2, planks, # Planked floor
64, 127, 127, True, 0, 1, False, True, False, 20, 60, 10, marsh, # Marsh
0, 127, 255, False, 0, 1, False, True, False, 12, 95, 10, water, # Water
0, 0, 255, False, 0, 1, False, True, True, 8, 100, 40, deepwater, # Deep water
6 changes: 2 additions & 4 deletions terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import images

celltypefields = [
('name', (numpy.str_, 19)),
('top', numpy.bool_),
('destructable', numpy.bool_),
('temperature', numpy.int8 ),
('fireignitechance',numpy.float_),
('fireoutchance', numpy.float_),
('hasroof', numpy.bool_),
('covered', numpy.bool_),
('transparent', numpy.bool_),
('solid', numpy.bool_),
('temperature', numpy.int8 ),
('sogginess', numpy.uint8),
('roughness', numpy.uint8)
]
Expand Down

0 comments on commit 04097de

Please sign in to comment.