-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharehouse.py
146 lines (129 loc) · 5.01 KB
/
sharehouse.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
from connect import *
#텍스트 고쳤음!
@app.route('/sharehouse_1', methods=['POST'])
def sharehouse_1():
content = request.get_json()
user_id = content['userRequest']['user']['id']
block_id = content['userRequest']['block']['id']
cur_progress = get_progress(user_id)
res = {
"version": "2.0",
"template": {
"outputs": [
{
"simpleText": {
"text": """‘옆 건물에서 아이 소리가 들렸다’는 센터장님의 지령을 따라 발길이 닿은 곳은 곧 무너질 듯한 낡은 건물 앞. 고개를 들면 보이는 작은 간판에는 ‘에덴 고시원’이라고 적혀 있었다."""
}
},
{
"simpleImage": {
"imageUrl": images.background_4, #시체
"altText": "이미지 로딩 실패",
"forwardable": False
}
},
{
"simpleText": {
"text": """카펫과 테이블, 자루 몇 개가 놓인 평범한 창고 같은 방 한가운데에 시체가 누워있었다. 역한 냄새를 풍기는 시체 옆에는 이상한 사진이 떨어져 있었다."""
}
}
] if cur_progress == 2 else [
{
"simpleImage": {
"imageUrl": images.background_4, #시체
"altText": "이미지 로딩 실패",
"forwardable": False
}
}
],
"quickReplies": [
{
"label": "시체를 조사한다.",
"action": 'block',
"blockId": blockId.고시원_2
},
{
"label": "방의 물건들을 조사한다.",
"action": 'block',
"blockId": blockId.고시원_3
},
{
"label": "이상한 사진을 조사한다.",
"action": 'block',
"blockId": blockId.고시원_4
}
]
}
}
if cur_progress == 2:
set_progress(user_id, 3)
save_block(user_id, block_id)
return jsonify(res)
@app.route('/sharehouse_2', methods=['POST'])
def sharehouse_2():
content = request.get_json()
user_id = content['userRequest']['user']['id']
block_id = content['userRequest']['block']['id']
save_block(user_id, block_id)
return response_from("""이미 부패가 시작된 남성의 시신이었다. 특이하게도 모든 치아가 뽑혀 바닥에 나뒹굴고 있었다. 사인은 과다출혈인 것 같았다.""",
quickReplies = [
{
"label": "돌아간다.",
"action": 'block',
"blockId": blockId.고시원_1
}
])
@app.route('/sharehouse_3', methods=['POST'])
def sharehouse_3():
content = request.get_json()
user_id = content['userRequest']['user']['id']
block_id = content['userRequest']['block']['id']
save_block(user_id, block_id)
return response_from("""특별할 것 없어 보이는 카펫과 테이블이 있었다. 자루 안에는 오래된 공구들이 들어있었다.""",
quickReplies = [
{
"label": "돌아간다.",
"action": 'block',
"blockId": blockId.고시원_1
}
])
@app.route('/sharehouse_4', methods=['POST'])
def sharehouse_4():
content = request.get_json()
user_id = content['userRequest']['user']['id']
block_id = content['userRequest']['block']['id']
res = {
"version": "2.0",
"template": {
"outputs": [
{
"simpleImage":{
"imageUrl": images.problem_3, #사진
"altText": "이미지 로딩 실패",
"forwardable": False
}
},
{
"simpleText": {
"text": """사진에는 난잡하게 찍힌 지문들, 그리고 사람의 양손이 찍혀 있었다. 성인보단 확연히 작은 그 손은 아이의 것 같아 보였다.
--------------------
(답을 채팅으로 입력하세요!)"""
}
}
],
"quickReplies": [
{
"label": "돌아간다.",
"action": 'block',
"blockId": blockId.고시원_1
},
{
"label": "힌트",
"action": 'block',
"blockId": blockId.힌트확인
}
]
}
}
save_block(user_id, block_id)
return jsonify(res)