blob: 42e7a8477b49355bbf47e0e3c4e98ef6f4b383cc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# -*- coding: utf8 -*-
#
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
import array
def getTileData(mapData, x, y, sx):
data = mapData[y * sx + x]
arr = array.array("B")
arr.fromstring(data)
data = arr[0]
return data
def getTile(data):
normal = 0
collision = 0
if data == 0: # 000 normal walkable
normal = 1
collision = 5
elif data == 1: # 001 non walkable
normal = 2
collision = 6
elif data == 2: # 010 same with 0
normal = 1
collision = 5
elif data == 3: # 011 same with 0, but water
normal = 3
collision = 5
elif data == 4: # 100 same with 0
normal = 1
collision = 5
elif data == 5: # 101 same with 1, but shootable (for now not supported!!!)
normal = 4
collision = 6
elif data == 6: # 110 same with 0
normal = 1
collision = 5
return (str(normal), str(collision))
def getGroundTile(flag):
return str(flag + 1)
def getCollisionTile(flag):
if flag == 0:
return "0"
return "4"
|