@@ -1070,52 +1070,53 @@ label .talking_start:
10701070 call clear_all
10711071 return
10721072
1073- label maica_connection_failure_dialogue (from_mspire = False ):
1073+ label maica_connection_failure_dialogue (from_mspire = False , status_code = None ):
10741074 $ ai = store.maica.maica_instance
1075+ $ failure_status = ai.status if status_code is None else status_code
10751076
1076- if ai.status == ai.MaicaAiStatus.TOKEN_MISSING:
1077+ if failure_status == ai.MaicaAiStatus.TOKEN_MISSING:
10771078 m 2 rusdlb " ...It seems you haven't got a token yet."
10781079 m 3 eusdlb " You can read the instruction here on how to: {a=https://maica.monika.love/tos}{u}{i} https://maica.monika.love/tos{/i}{/u}{/a} , you just have to prepare an account."
10791080 m 3 eua " I'll nail everything else for you."
10801081
1081- elif ai.status == ai.MaicaAiStatus.TOKEN_CORRUPTED:
1082+ elif failure_status == ai.MaicaAiStatus.TOKEN_CORRUPTED:
10821083 m 2 rusdlb " ...The token seems corrupted. You sure you didn't mess with it?"
10831084 m 3 eusdlb " Just re-generate one with username and password, and things shall work."
10841085
1085- elif ai.status == ai.MaicaAiStatus.TOKEN_INVALID:
1086+ elif failure_status == ai.MaicaAiStatus.TOKEN_INVALID:
10861087 m 2 rusdlb " ...Password incorrect. You sure you didn't make a typo?"
10871088 m 3 eusdlb " Double check it please, or change it if you really don't remember."
10881089
1089- elif ai.status == ai.MaicaAiStatus.LOGIN_BLOCKED:
1090+ elif failure_status == ai.MaicaAiStatus.LOGIN_BLOCKED:
10901091 m 2 rusdlb " ...Fail2Ban? That's twenty incorrect passwords in a row."
10911092 m 3 eusdlb " You'd better contact administrator if that wasn't you, or just change a password if you really don't remember."
10921093
1093- elif ai.status == ai.MaicaAiStatus.ACCOUNT_BANNED:
1094+ elif failure_status == ai.MaicaAiStatus.ACCOUNT_BANNED:
10941095 m 2 rusdlb " ...Account banned? What is that, you didn't do anything nasty did you?"
10951096 m 3 eusdlb " Well, check out when will it recover please."
10961097 m 1 husdla " And in case it's a permanent one... It's not like we {i} must{/i} go there, being by your side is always satisfying enough to me."
10971098
1098- elif ai.status == ai.MaicaAiStatus.EMAIL_UNVERIFIED:
1099+ elif failure_status == ai.MaicaAiStatus.EMAIL_UNVERIFIED:
10991100 m 2 rusdlb " ...You received your verification email yet? {w=0.3} You didn't check it, silly!"
11001101 m 3 eusdlb " Just verify your email at the registration site, and things shall work."
11011102
1102- elif ai.status == ai.MaicaAiStatus.TOS_UNACCEPTED:
1103+ elif failure_status == ai.MaicaAiStatus.TOS_UNACCEPTED:
11031104 m 2 rusdlb " ...You didn't check the ToS, or it might have been updated since you last check it."
11041105 m 3 eusdlb " You can go to the registration site and do it in a minute, could you?"
11051106
1106- elif ai.status == ai.MaicaAiStatus.CONNECTION_REUSE_DENIED:
1107+ elif failure_status == ai.MaicaAiStatus.CONNECTION_REUSE_DENIED:
11071108 m 2 rusdlb " ...This is weird, it says a connection has been established already."
11081109 m 3 eusdlb " Try restarting the game or rebooting your computer, shall we?"
11091110
11101111 elif (
1111- ai.status == ai.MaicaAiStatus.SERVER_REJECTED
1112+ failure_status == ai.MaicaAiStatus.SERVER_REJECTED
11121113 and from_mspire
11131114 ):
11141115 m 2 eksdlc " ...Nah, this one looks broken. {w=0.3} If you've manually configured MSpire, consider double checking it?"
11151116 m 3 rusdlb " And still, it could just be Wikipedia's problem. It's such a large and complex public website after all."
11161117 m 3 eua " Anyway, we can always try it again later, so don't worry."
11171118
1118- elif ai.status in (
1119+ elif failure_status in (
11191120 ai.MaicaAiStatus.TOKEN_GENERATION_FAILED,
11201121 ai.MaicaAiStatus.FAILED_GET_NODE,
11211122 ai.MaicaAiStatus.RESPONSE_INVALID,
@@ -1126,23 +1127,23 @@ label maica_connection_failure_dialogue(from_mspire = False):
11261127 m 3 eusdlb " What about checking the announcements, or ask someone else if they could connect?"
11271128 m 3 eua " Contact administrator if this is just happening to you, or wait patiently if not."
11281129
1129- elif ai.status == ai.MaicaAiStatus.SERVER_MAINTAIN:
1130+ elif failure_status == ai.MaicaAiStatus.SERVER_MAINTAIN:
11301131 m 2 rusdlb " ...It says that the server is not serving, might be running some tests."
11311132 m 3 eusdlb " Just wait for it to come back online, shall we? You can always follow the progress in the tracking thread."
11321133
1133- elif ai.status == ai.MaicaAiStatus.CERTIFI_BROKEN:
1134+ elif failure_status == ai.MaicaAiStatus.CERTIFI_BROKEN:
11341135 m 2 rusdlb " ...Certification issue? Maybe this isn't a clean installation?"
11351136 m 3 eusdlb " Try the MAS native 'update certification' function, some other submods could break these as I know."
11361137
1137- elif ai.status == ai.MaicaAiStatus.CERTIFI_RESTART_REQUIRED:
1138+ elif failure_status == ai.MaicaAiStatus.CERTIFI_RESTART_REQUIRED:
11381139 m 2 rusdlb " ...Uh, seems I have to apply a quick fix on the certification."
11391140 m 3 eua " It needs a restart to take effect, then we can try again."
11401141
1141- elif ai.status == ai.MaicaAiStatus.VERSION_OLD:
1142+ elif failure_status == ai.MaicaAiStatus.VERSION_OLD:
11421143 m 2 rusdlb " ...You have to update the submod once in a while, [player] !"
11431144 m 3 eusdlb " This version is too old to work already, update it whenever you have some time."
11441145
1145- elif ai.status in (
1146+ elif failure_status in (
11461147 ai.MaicaAiStatus.NO_INTERNET,
11471148 ai.MaicaAiStatus.CONNECT_PROBLEM,
11481149 ):
@@ -1475,67 +1476,84 @@ label maica_mpostal_replyed:
14751476 curr_queue_count += 1
14761477 return curr_queue_count
14771478
1478- def _reset_failed_mp ():
1479- for i in persistent._maica_send_or_received_mpostals:
1480- if i[" responsed_status" ] == " failed" :
1481- i[" responsed_status" ] = " notupload"
1482-
1483-
1484- $ morethan1 = False
1479+ $ seq = 0
14851480
14861481 # 这里是生成结果
1487- label maica_mpostal_replyed .select_little :
1482+ label maica_mpostal_replyed .select_letter( is_repeat = False ) :
14881483 $ current = None
14891484 python :
1490- for little in persistent._maica_send_or_received_mpostals:
1491- if little [" responsed_status" ] in [" received" , " failed" , " notupload" ]:
1492- current = little
1485+ for letter in persistent._maica_send_or_received_mpostals:
1486+ if letter [" responsed_status" ] in [" received" , " failed" , " notupload" ]:
1487+ current = letter
14931488 break
14941489 if current is None :
14951490 jump maica_mpostal_replyed.end
14961491
14971492label maica_mpostal_replyed .start:
1498- if current[" responsed_status" ] == " failed" :
1499- m 2l ksdlb " Oh, [player] , {w=0.5} About your last letter..." # 担心
1500- m 2 ekc " It seems that the Heaven Forest is not ready, I couldn't write you back." # 担心
1501- m 3 eusdlb " You can read the instruction here on how to: {a=https://maica.monika.love/tos}{u}{i} https://maica.monika.love/tos{/i}{/u}{/a} , you just have to prepare an account."
1502- m 3 eua " I'll nail everything else for you."
1503- m 1 eua " It's okay, I'll remember to write it as soon as you finish the preparation."
1504- $ _reset_failed_mp()
1505- return " no_unlock"
1506- elif current[" responsed_status" ] in (" received" , " notupload" ):
1507- if not morethan1:
1493+ $ seq += 1
1494+
1495+ # This method iters over ALL history letters.
1496+ # That means we cannot include "fatal"s in, because they'd come up every time before manually handled.
1497+ # So we only write reactions for non-stale status.
1498+ if current[" responsed_status" ] in (" failed" ):
1499+ if not is_repeat:
1500+ if seq <= 1 :
1501+ m 2l ksdlb " Uh, [player] , {w=0.5} about your last letter." # 担心
1502+ else :
1503+ m 2l ksdlb " Uh, [player] , {w=0.5} and for the next letter."
1504+ m 2 ekc " The Heaven Forest seems to had a problem, that was..." # 担心
1505+ else :
1506+ m 2l ksdlb " Uh, [player] , I'm really sorry but the Heaven Forest seems not working now."
1507+ m 2 ekc " Let me see..."
1508+
1509+ call maica_connection_failure_dialogue(status_code = current.get(" failure_status" ))
1510+ if current[" responsed_status" ] == " failed" :
1511+ m 1 eua " It's okay, I'll remember to write you back as soon as you address that issue."
1512+ $ current[" responsed_status" ] = " notupload"
1513+
1514+ elif current[" responsed_status" ] in (" received" ):
1515+ if seq <= 1 :
15081516 m 7 hub " Oh, [player] ! {w=0.5} I've finished writing you my reply!"
1509- $ morethan1 = True
15101517 else :
1511- m 7 husdlb " .{w=0.3} .{w=0.3} .And here's another one!"
1512- if current[" responsed_status" ] == " received" :
1513- m 6 dsc " Just a second, let me find it out.{w=0.3} .{w=0.3} ." # 闭眼
1514- m 3 hubsa " Here it is!" # 微笑
1515- elif current[" responsed_status" ] == " notupload" :
1516- if not morethan1:
1517- m 3 eksdlb " Just a minute, I've not finished...{w=0.2} preparing this yet." # 尴尬
1518- m 1 hua " I'll be back soon, wait for me~" # 微笑
1519- else :
1520- m 1 dsa " Just another minute..." # 微笑
1521- show black with dissolve
1522- call maica_mpostal_read
1523- if _return == " failed" :
1524- hide black with dissolve
1525- # 直接重新开始, 失败的信会提示失败, 理论应与current一致
1526- jump maica_mpostal_replyed.select_little
1527- m " And it's done!"
1518+ m 7 husdlb " .{w=0.3} .{w=0.3} .And here's another one I finished!"
1519+
1520+ m 6 dsc " Just a second, let me find it out.{w=0.3} .{w=0.3} ." # 闭眼
1521+ m 3 hubsa " Here it is!" # 微笑
1522+
1523+ call maica_mpostal_show(current[" responsed_content" ])
1524+ $ current[" responsed_status" ] = " readed"
1525+
1526+ elif current[" responsed_status" ] in (" notupload" ):
1527+ if seq <= 1 :
1528+ m 3 eksdlb " Oh, your letter [player] ! I was kind of in a hurry so it's not completely ready yet." # 尴尬
1529+ else :
1530+ m 3 eksdlb " Oh, here's another one! I was kind of in a hurry so it's not completely ready yet." # 尴尬
1531+ m 1 hua " I'll be back soon, wait for me!" # 微笑
1532+
1533+ show black with dissolve
1534+ call maica_mpostal_read
1535+
1536+ if _return == " failed" :
15281537 hide black with dissolve
1538+ # 直接重新开始, 失败的信会提示失败, 理论应与current一致
1539+ jump maica_mpostal_replyed.select_letter(is_repeat = True )
1540+
1541+ m " Okay, here it is!"
1542+ hide black with dissolve
15291543 call maica_mpostal_show(current[" responsed_content" ])
15301544 $ current[" responsed_status" ] = " readed"
1531- jump maica_mpostal_replyed.select_little
1545+
1546+ jump maica_mpostal_replyed.select_letter
15321547
15331548label maica_mpostal_replyed .end:
15341549 if ev.shown_count <= 2 :
15351550 m 2l ksdlb " I have to admit that I'm not quite used to writing here, but I hope it's not too bad!"
1536- else :
1551+ elif ev.shown_count <= 4 :
15371552 m 2l ksdlb " May not as good as my former poems though, but I really tried. Hope you like it!"
1538- m 5 ekbsa " And welcome writing to me again anytime!"
1553+ else :
1554+ $ it = renpy.substitute(_(" it" ) if seq <= 1 else _(" these" ))
1555+ m 2 tublu " I have to assume you're loving {it} now, since you did write to me a lot!"
1556+ m 5 ekbsa " And welcome writing to me again anytime you like!"
15391557 return " no_unlock"
15401558
15411559
0 commit comments