-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelements.py
100 lines (74 loc) · 2.54 KB
/
elements.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from main import Pixel
import random
class ImmovableSolid(Pixel):
def __init__(self):
super().__init__()
self.check_spots = []
class MoveableSolid(Pixel):
def __init__(self):
super().__init__()
self.check_spots = [[(0,-1)],[(-1,-1),(1,-1)]]
class Liquid(Pixel):
def __init__(self):
super().__init__()
self.check_spots = [[(0,-1)],[(-1,-1),(1,-1)],[(1,0),(-1,0)]]
class Gas(Pixel):
def __init__(self):
super().__init__()
self.check_spots = [[(0,1),(1,1),(-1,1)],[(-1,0),(1,0)]]
# Pixel Materials
class Wood(ImmovableSolid):
def __init__(self):
super().__init__()
self.color = random.choice([(130, 91, 48),(135, 95, 51)])
self.weight = 1000000
self.heat = 0
self.reactions = [{"element": Acid, "result": None}]
class Sand(MoveableSolid):
def __init__(self):
super().__init__()
self.color = random.choice([(235, 235, 164),(217, 217, 154),(207, 207, 147)])
self.weight = 30
self.heat = 0
self.reactions = [{"element": Acid, "result": None}]
class Rock(MoveableSolid):
def __init__(self):
super().__init__()
self.color = random.choice([(131, 124, 143),(131, 124, 143),(134, 128, 150)])
self.weight = 30
self.heat = 0
self.reactions = [{"element": Acid, "result": None}]
class Water(Liquid):
def __init__(self):
super().__init__()
self.color = random.choice([(67, 137, 156),(67, 136, 156),(67, 135, 156)])
self.weight = 10
self.heat = 0
self.reactions = [{"element": Lava, "result": Steam}]
class Lava(Liquid):
def __init__(self):
super().__init__()
self.color = random.choice([(245, 100, 10),(245, 100, 9),(245, 100, 8)])
self.weight = 20
self.heat = 100
self.reactions = [{"element": Water, "result": Rock}]
class Steam(Gas):
def __init__(self):
super().__init__()
self.color = random.choice([(154, 156, 154),(157, 158, 153)])
self.weight = 1
self.heat = 10
self.time_convertion = {"element": Water, "time": random.randint(1,400) + 200, "chance": 0.5}
class Acid(Liquid):
def __init__(self):
super().__init__()
self.color = random.choice([(86, 231, 80),(86, 232, 81)])
self.heat = 0
self.reactions = [{"element": Rock, "result": AerosoleAcid},{"element": Sand, "result": AerosoleAcid},{"element": Wood, "result": AerosoleAcid}]
class AerosoleAcid(Gas):
def __init__(self):
super().__init__()
self.color = random.choice([(144, 237, 140)])
self.weight = 0.97
self.heat = 10
self.time_convertion = {"element": Acid, "time": random.randint(1,400) + 200, "chance": 0.1}