Skip to content

Commit

Permalink
Activity for IOS2 and WP
Browse files Browse the repository at this point in the history
  • Loading branch information
yueyoum committed Apr 20, 2016
1 parent 67f1817 commit 43b71f0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 39 deletions.
2 changes: 1 addition & 1 deletion sanguo/callbacks/signals/purchase.py
Expand Up @@ -39,7 +39,7 @@ def _new_purchase(char_id, new_got, total_got, **kwargs):
if ActivityEntry(char_id, 30006).trig(new_got):
acs.send_update_notify(activity_ids=[30006])

ActivityEntry(char_id, 4000).trig()
ActivityEntry(char_id, 40000).trig()

new_purchase_signal.connect(
_new_purchase,
Expand Down
3 changes: 2 additions & 1 deletion sanguo/core/activity.py
Expand Up @@ -1205,6 +1205,7 @@ def get_condition_status(self, condition_id):
@activities.register(40000)
class Activity40000(ActivityBase):
# 任意充值
CONDITION_ID = -40000
def get_current_value(self, char_id):
return 0

Expand Down Expand Up @@ -1303,7 +1304,7 @@ def trig(self):
return

date_str = now.format('YYYY-MM-DD')
key = 'activity40006#{0)#{1}'.format(
key = 'activity40006#{0}#{1}'.format(
date_str, self.char_id
)

Expand Down
8 changes: 7 additions & 1 deletion sanguo/core/prison.py
Expand Up @@ -219,9 +219,15 @@ def _fill_up_prisoner_msg(self, p, _id, oid, prob, active):


def send_prisoners_notify(self):
ae = ActivityEntry(self.char_id, 40008)
if ae and ae.is_ok():
_add_prob = 80
else:
_add_prob = 0

msg = protomsg.PrisonerListNotify()
for k, v in self.p.prisoners.iteritems():
p = msg.prisoner.add()
self._fill_up_prisoner_msg(p, int(k), v.oid, v.prob, v.active)
self._fill_up_prisoner_msg(p, int(k), v.oid, v.prob + _add_prob, v.active)

publish_to_char(self.char_id, pack_msg(msg))
70 changes: 35 additions & 35 deletions sanguo/preset/fixtures/activity_static.json
Expand Up @@ -426,7 +426,7 @@
"category": 2,
"interval_days": 0,
"name": "\u8fde\u7eed\u767b\u9646\u9001\u5927\u793c",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524d\u5df2\u767b\u5f55\u5929\u6570\uff1a${0}",
"start_time": "2016-03-28",
"des": "\u8fde\u7eed\u767b\u96465\u5929\uff0c\u5c06\u6709\u5927\u793c\u76f8\u9001",
Expand Down Expand Up @@ -466,7 +466,7 @@
"category": 2,
"interval_days": 0,
"name": "\u6b66\u5c06\u8fdb\u9636\u9001\u8c6a\u793c",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5df2\u8fdb\u9636\u6b21\u6570:${0}",
"start_time": "2016-03-28",
"des": "\u7d2f\u79ef\u8fdb\u884c5\u6b21\u6b66\u5c06\u8fdb\u9636\uff0c\u5c06\u6709\u60ca\u559c\u53ef\u62ff",
Expand Down Expand Up @@ -506,7 +506,7 @@
"category": 2,
"interval_days": 0,
"name": "\u7d2f\u79ef\u5145\u503c\u6709\u60ca\u559c",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524d\u5df2\u5145\u503c\uff1a${0}",
"start_time": "2016-03-28",
"des": "\u7d2f\u79ef\u5145\u503c980\u5143\u5b9d\u5c06\u6709\u5927\u793c\u53ef\u62ff",
Expand All @@ -526,9 +526,9 @@
"category": 2,
"interval_days": 0,
"name": "\u653b\u57ce\u7565\u5730",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5df2\u63a0\u593a\uff1a${0}",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6210\u529f\u63a0\u593a50\u6b21\uff0c\u6d77\u91cf\u94f6\u4e24\u9001\u4e0d\u505c",
"interval_times": 0,
"package": null,
Expand All @@ -546,9 +546,9 @@
"category": 2,
"interval_days": 0,
"name": "\u5143\u5b9d\u70b9\u5c06\u9001\u5927\u793c",
"continued_days": 24,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5df2\u70b9\u5c06\uff1a${0}",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u4f7f\u7528\u5143\u5b9d\u70b9\u5c0618\u6b21\uff0c\u571f\u58d5\u5927\u793c\u9001\u4e0d\u505c",
"interval_times": 0,
"package": null,
Expand All @@ -566,7 +566,7 @@
"category": 2,
"interval_days": 0,
"name": "\u6b66\u5c06\u5b9d\u76d2\u5151\u6362\u793c",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5df2\u6709\u6b66\u5c06\u5b9d\u76d2:${0}",
"start_time": "2016-03-28",
"des": "\u4f7f\u7528\u6b66\u5c06\u5b9d\u76d2\uff0c\u597d\u793c\u8ddf\u4f60\u8d70",
Expand Down Expand Up @@ -606,9 +606,9 @@
"category": 2,
"interval_days": 0,
"name": "\u7d2f\u79ef\u5145\u503c\u5956\u52b1",
"continued_days": 24,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5145\u503c\uff1a${0}",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u671f\u95f4\u7d2f\u8ba1\u5145\u503c\u6307\u5b9a\u91d1\u989d\u5373\u53ef\u9886\u53d6\u5956\u52b1",
"interval_times": 0,
"package": null,
Expand Down Expand Up @@ -666,7 +666,7 @@
"category": 2,
"interval_days": 0,
"name": "\u7ade\u6280\u573a\u6bd4\u6b6650\u6b21",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524d\u5df2\u6bd4\u6b66\uff1a${0}",
"start_time": "2016-03-28",
"des": "\u7ade\u6280\u573a\u6bd4\u6b6650\u6b21\uff0c\u6d77\u91cf\u94f6\u4e24\u9001\u4e0d\u505c",
Expand All @@ -686,7 +686,7 @@
"category": 2,
"interval_days": 0,
"name": "40\u6b21\u5b9d\u77f3\u5408\u6210",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524d\u5df2\u5408\u6210\uff1a${0}",
"start_time": "2016-03-28",
"des": "\u8fdb\u884c40\u6b21\u5b9d\u77f3\u5408\u6210\uff0c\u53ef\u9886\u53d6\u94f6\u5e01",
Expand All @@ -706,7 +706,7 @@
"category": 2,
"interval_days": 0,
"name": "\u83b7\u5f9750\u540d\u6b66\u5c06",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524d\u5df2\u6709\u6b66\u5c06\uff1a${0}",
"start_time": "2016-03-28",
"des": "\u83b7\u5f9750\u540d\u6b66\u5c06\uff0c\u53ef\u9886\u53d6\u597d\u793c",
Expand All @@ -726,7 +726,7 @@
"category": 2,
"interval_days": 0,
"name": "\u5185\u653f\u94f6\u4e24\u7ffb\u500d",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u6302\u673a\u94f6\u4e24\u4ea7\u51fa\u7ffb\u500d",
"start_time": "2016-03-28",
"des": "\u6d3b\u52a8\u671f\u95f4\u5185\u653f\u6302\u673a\u94f6\u4e24\u4ea7\u51fa\u7ffb\u500d",
Expand All @@ -746,7 +746,7 @@
"category": 2,
"interval_days": 0,
"name": "VIP6\u798f\u5229\u6d3b\u52a8",
"continued_days": 24,
"continued_days": 0,
"current_des": "\u5f53\u524dVIP\u7b49\u7ea7{0}",
"start_time": "2016-03-28",
"des": "VIP6\u7ea7\u4ee5\u4e0a\u73a9\u5bb6\uff0c\u63a0\u593a\u4fd8\u864f\u6982\u7387100%",
Expand All @@ -766,9 +766,9 @@
"category": 2,
"interval_days": 0,
"name": "\u5355\u7b14\u5145\u503c\u5927\u793c",
"continued_days": 24,
"continued_days": 25,
"current_des": "\u5355\u7b14\u5145\u503c\u9001\u5927\u793c",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u5355\u7b14\u5145\u503c\u9001\u5927\u793c",
"interval_times": 0,
"package": null,
Expand All @@ -786,9 +786,9 @@
"category": 2,
"interval_days": 0,
"name": "\u4efb\u610f\u5145\u503c\u9001\u793c",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5df2\u5145\u503c${0}",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u671f\u95f4\u5b8c\u6210\u4e00\u6b21\u4efb\u610f\u91d1\u989d\u5145\u503c\uff0c\u9886\u53d6\u94f6\u5e01*18888\uff0c\u5c0f\u8d21\u54c1\u5b9d\u7bb1*2\uff0c\u6b66\u5c06\u5b9d\u76d2*1",
"interval_times": 0,
"package": 400010,
Expand All @@ -806,9 +806,9 @@
"category": 2,
"interval_days": 0,
"name": "\u4e4c\u5de2\u4e4b\u6218",
"continued_days": 10,
"current_des": "\u5f53\u524d\u80dc\u5229${0}\u6b2140001",
"start_time": "2016-04-19",
"continued_days": 25,
"current_des": "\u5f53\u524d\u80dc\u5229${0}\u6b21",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u526f\u672c\u4e4c\u5de2\u4e4b\u6218\u80dc\u522920\u6b21\u3002",
"interval_times": 0,
"package": null,
Expand All @@ -826,9 +826,9 @@
"category": 2,
"interval_days": 0,
"name": "\u7ade\u6280\u573a\u6bd4\u6b66\u83b7\u80dc",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5df2\u83b7\u80dc${0}\u6b21",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u7ade\u6280\u573a\u6bd4\u6b66\u83b7\u5f9730\u6b21\u80dc\u5229\u3002",
"interval_times": 0,
"package": null,
Expand All @@ -846,9 +846,9 @@
"category": 2,
"interval_days": 0,
"name": "\u4e94\u884c\u5c5e\u6027\u5f3a\u5316",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5347\u7ea7\u4e94\u884c\u5c5e\u6027\u52305\u7ea7",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u671f\u95f4\u5c06\u4e00\u4e2a\u6b66\u5c06\u4e94\u884c\u5c5e\u6027\u5347\u52305\u7ea7",
"interval_times": 0,
"package": null,
Expand All @@ -866,9 +866,9 @@
"category": 2,
"interval_days": 0,
"name": "\u8fdb\u9636\u4e94\u661f\u6b66\u5c06",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u8fdb\u9636\u4e00\u4e2a\u4e94\u661f\u6b66\u5c06",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u671f\u95f4\uff0c\u5c06\u4e00\u4e2a\u6b66\u5c06\u8fdb\u9636\u4e3a\u4e94\u661f\u6b66\u5c06",
"interval_times": 0,
"package": null,
Expand All @@ -886,9 +886,9 @@
"category": 2,
"interval_days": 0,
"name": "\u795e\u88c5\u5927\u6d3e\u9001",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524d\u62e5\u6709\u6b66\u5c06\u5982\u610f${0}\u4e2a",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6536\u96c6\u6b66\u5c06\u5982\u610f\uff0c\u9886\u53d6\u8d85\u7ea7\u88c5\u5907",
"interval_times": 0,
"package": null,
Expand All @@ -906,12 +906,12 @@
"category": 2,
"interval_days": 0,
"name": "\u5b9a\u65f6\u6bd4\u6b66\u9001\u798f\u5229",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524d\u5df2\u6bd4\u6b66${0}\u6b21",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "\u6d3b\u52a8\u671f\u95f420\u70b9-12\u70b9\u8fdb\u884c\u8fc7\u6bd4\u6b66\u7684\u73a9\u5bb6\uff0c\u5c06\u83b7\u5f97\u94f6\u4e24\u5b9d\u7bb1X1",
"interval_times": 0,
"package": 400001,
"package": 400015,
"mail_title": "\u5b9a\u65f6\u6bd4\u6b66\u798f\u5229\u5230",
"mail_content": "\u65e0\u6240\u4e0d\u80fd\u7684\u7cfb\u7edf\u5927\u795e\u68c0\u6d4b\u5230\u4eb2\u7231\u7684\u5bbf\u4e3b\u5728\u6307\u5b9a\u65f6\u95f4\u5185\u53c2\u52a0\u8fc7\u6bd4\u6b66\uff0c\u5927\u65b9\u8c6a\u6c14\u7684\u7cfb\u7edf\u51b3\u5b9a\u5956\u52b1\u60a8\u4e00\u4e2a\u94f6\u4e24\u7bb1",
"mode": 2,
Expand All @@ -926,9 +926,9 @@
"category": 2,
"interval_days": 0,
"name": "VIP\u73a9\u5bb6\u798f\u5229\u4e00",
"continued_days": 10,
"continued_days": 25,
"current_des": "\u5f53\u524dVIP\u7b49\u7ea7\uff1a${0}",
"start_time": "2016-04-19",
"start_time": "2016-04-21",
"des": "VIP3\u4ee5\u4e0a\u73a9\u5bb6\u884c\u519b\u4ee4\u4e0a\u7ebf\u4e3a10\u4e2a",
"interval_times": 0,
"package": null,
Expand Down
21 changes: 20 additions & 1 deletion sanguo/preset/fixtures/package.json
Expand Up @@ -7383,7 +7383,7 @@
"stuffs": [
{
"amount": 2,
"id": 30,
"id": 33,
"prob": 100000
},
{
Expand Down Expand Up @@ -7481,6 +7481,25 @@
"stuffs": [],
"official_exp": 0
},
"400015": {
"gems": [],
"horses": [],
"sycee": 0,
"heros": [],
"gold": 0,
"souls": [],
"equipments": [],
"mode": 1,
"exp": 0,
"stuffs": [
{
"amount": 1,
"id": 31,
"prob": 100000
}
],
"official_exp": 0
},
"102": {
"gems": [
{
Expand Down

0 comments on commit 43b71f0

Please sign in to comment.