summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--bar.json6
-rw-r--r--battle/common.py29
-rw-r--r--battle/main.py1
-rw-r--r--quests.json236
-rwxr-xr-xserver.py10
-rw-r--r--story.json73
7 files changed, 345 insertions, 11 deletions
diff --git a/README.md b/README.md
index 3bb6cf2..a486446 100644
--- a/README.md
+++ b/README.md
@@ -154,6 +154,7 @@ After the server start, it will listen for a few commands. They are listed below
| raw | eval | Evaluates an arbitrary Python statement if server is in debug mode. |
| run | exec | Executes an arbitrary Python statement if server is in debug mode. |
| status | st | Reports status regarding server health |
+| list | all | Reports data on all connected clients |
| ddos | dcall | Disconnects all unauthed clients. |
| ddosban | dcbanall | Disconnects all unauthed clients, and ban their IP for half hour. |
diff --git a/bar.json b/bar.json
index a856edc..d33cda9 100644
--- a/bar.json
+++ b/bar.json
@@ -1,6 +1,6 @@
[
{
- "price": 200,
+ "price": 150,
"currency": "crystals",
"min_quest": 0,
"min_draws": 10,
@@ -56,7 +56,7 @@
]
},
{
- "price": 200,
+ "price": 150,
"currency": "crystals",
"min_quest": 10,
"min_draws": 10,
@@ -86,7 +86,7 @@
]
},
{
- "price": 350,
+ "price": 250,
"currency": "crystals",
"min_quest": -1,
"min_draws": 5,
diff --git a/battle/common.py b/battle/common.py
index dadc49d..a8407fe 100644
--- a/battle/common.py
+++ b/battle/common.py
@@ -24,8 +24,8 @@ from consts import (SC_ATKUP, SC_DEFDOWN, SC_DEFUP, SC_ATKDOWN,
SFLAG_CLEARGEMS, SFLAG_DOUBLEGEMS, SFLAG_SPECIAL,
SFLAG_FIRSTLOOT, SFLAG_DOUBLEEXP, SFLAG_DOUBLEGP,
SPH_WIDEATTACK, SPH_PIERCE, SPH_ASSAULT, SPH_HEAL, SPH_HEALALL, SPH_ATKUP,
- SPH_DEFUP, SPH_NONE, SRV_SPHERE, SRV_WAVE)
-import random
+ SPH_DEFUP, SPH_NONE, SRV_SPHERE, SRV_WAVE, SRV_NOCAST)
+import random, traceback
import player
#############################################
@@ -95,13 +95,15 @@ def attackall(token, atker, scope):
for c, i in enumerate(Battle[token][scope]):
if (i["hp"] < 0):
continue
- i["hp"]-=calc_dmg(token, atker, i, atker["atk"], 0.0)
+
+ dmg = calc_dmg(token, atker, i, atker["atk"], 0.0)
+ i["hp"]-=dmg
# If passed with a negative value...
if (i["hp"] > i["max_hp"]):
i["hp"]=0+i["max_hp"]
- #Battle[token]["log"].append(["party", idx, sphere, dmg, scope, c])
+ Battle[token]["log"].append(["", 0, SRV_NOCAST, dmg, scope, c])
return False
#############################################
@@ -199,6 +201,7 @@ def advance_wave(token, world, quest_id, next_wave):
"hp": int(900*mil),
"atk": int(100*mil),
"ele": en["attribute"],
+ "job": 2, # FIXME
"status_effects": 0
})
@@ -207,6 +210,22 @@ def advance_wave(token, world, quest_id, next_wave):
Battle[token]["wave"]+=1
return True
+
+##################################################
+# Levels up your summoning skill
+qids = [-1, 7]
+def summonlv(token, qid):
+ try:
+ level = qids.index(qid)
+ stdout("Adjusting player summon level (%d/%d)" % (Player[token]["max_sum"], level), 2)
+ Player[token]["max_sum"] = max(Player[token]["max_sum"], level)
+ except ValueError:
+ stdout("Quest does not affect summoning", 2)
+ except:
+ traceback.print_exc()
+ stdout("Error at summoning level check for quest %d" % qid)
+ return
+
#############################################
# get_result(str, bool, str, int)
def get_result(token, victory, world, quest_id):
@@ -236,6 +255,8 @@ def get_result(token, victory, world, quest_id):
# TODO: HANDLE THIS ERROR (FIXME)
return result
+ # Check if your summoning level has improved
+ summonlv(token, quest_id)
stdout("GR: Rolling", 2)
# Roll each wave
# Base quest experience gain
diff --git a/battle/main.py b/battle/main.py
index a477171..caa2c2e 100644
--- a/battle/main.py
+++ b/battle/main.py
@@ -136,6 +136,7 @@ def begin_quest(args, token, client_side=True):
"hp": un["hp"]+hpboost,
"atk": un["strength"]+akboost,
"ele": un["attribute"],
+ "job": un["job"],
"status_effects": 0
})
diff --git a/quests.json b/quests.json
index 8266d73..94bb42e 100644
--- a/quests.json
+++ b/quests.json
@@ -481,10 +481,38 @@
"waves": [
[
{
- "attribute": 1,
+ "attribute": 3,
"boss": false,
+ "name": "Eagle Scout",
+ "sprite": 950004
+ },
+ {
+ "attribute": 3,
+ "boss": false,
+ "name": "Eagle Scout",
+ "sprite": 950004
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": true,
"name": "Spearman",
"sprite": 950000
+ },
+ {
+ "attribute": 1,
+ "boss": true,
+ "name": "Lieutenant",
+ "sprite": 950002
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": true,
+ "name": "Flag Bearer",
+ "sprite": 950005
}
]
],
@@ -518,6 +546,58 @@
"boss": false,
"name": "Spearman",
"sprite": 950000
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Conscript",
+ "sprite": 950003
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Conscript",
+ "sprite": 950003
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Conscript",
+ "sprite": 950003
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Foot Soldier",
+ "sprite": 950001
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Foot Soldier",
+ "sprite": 950001
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Foot Soldier",
+ "sprite": 950001
}
]
],
@@ -540,6 +620,160 @@
},
{
"bg": "battle",
+ "difficulty": 28,
+ "cost": 4,
+ "flags": 1,
+ "quest_id": 9,
+ "waves": [
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Officer",
+ "sprite": 950002
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Flag Bearer",
+ "sprite": 950005
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Conscript",
+ "sprite": 950003
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Officer",
+ "sprite": 950002
+ }
+ ],
+ [
+ {
+ "attribute": 3,
+ "boss": true,
+ "name": "Scouting Leader",
+ "sprite": 960004
+ }
+ ]
+ ],
+ "music": "bgm03",
+ "requeriment": 8,
+ "loot": [
+ [
+ "1010",
+ 1050
+ ],
+ [
+ "1020",
+ 120
+ ],
+ [
+ "1030",
+ 12
+ ]
+ ]
+ },
+ {
+ "bg": "battle",
+ "difficulty": 32,
+ "cost": 4,
+ "flags": 1,
+ "quest_id": 10,
+ "waves": [
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Officer",
+ "sprite": 950002
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Officer",
+ "sprite": 950002
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Officer",
+ "sprite": 950002
+ }
+ ],
+ [
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ },
+ {
+ "attribute": 1,
+ "boss": false,
+ "name": "Spearman",
+ "sprite": 950000
+ }
+ ],
+ [
+ {
+ "attribute": 3,
+ "boss": false,
+ "name": "Eagle Scout",
+ "sprite": 950004
+ },
+ {
+ "attribute": 3,
+ "boss": false,
+ "name": "Eagle Scout",
+ "sprite": 950004
+ }
+ ],
+ [
+ {
+ "attribute": 0,
+ "boss": true,
+ "name": "The Conqueror",
+ "sprite": 960005
+ }
+ ]
+ ],
+ "music": "bgm03",
+ "requeriment": 9,
+ "loot": [
+ [
+ "1010",
+ 1050
+ ],
+ [
+ "1020",
+ 120
+ ],
+ [
+ "1030",
+ 12
+ ]
+ ]
+ },
+ {
+ "bg": "battle",
"difficulty": 45,
"cost": 10,
"flags": 4,
diff --git a/server.py b/server.py
index e465ba8..1a3a7cd 100755
--- a/server.py
+++ b/server.py
@@ -27,7 +27,7 @@ from websock import WebSocketServer, WebSocket
## Local Modules
from utils import stdout, now, clients, debug
from consts import MAX_CLIENTS, PACKET_ACK
-import protocol, security, player, traceback
+import protocol, security, player, utils, traceback
###############################################################
# Configuration
@@ -220,9 +220,11 @@ try:
elif cmd in ["dbg", "debug"]:
if debug == 2:
debug = 0
+ utils.debug = 0
else:
debug += 1
- stdout("Changed debug mode to %d" % debug)
+ utils.debug += 1
+ stdout("Changed debug mode to %d" % debug, 0)
elif cmd in ["raw", "eval"] and debug:
try:
print(eval(com))
@@ -238,6 +240,10 @@ try:
elif cmd in ["status", "st"]:
stdout("Total clients connected: %d" % len(clients))
stdout("Total blacklist size: %d" % len(security.blacklist))
+ elif cmd in ["list", "all"]:
+ stdout("Total clients connected: %d" % len(clients))
+ for cli in clients:
+ print("[%d] %s - %s" % (cli.userid, cli.token, cli.address[0]))
elif cmd in ["kick", "dc"]:
totaldc=disconnect(com)
stdout("Disconnected %d clients." % totaldc)
diff --git a/story.json b/story.json
index f5faf7c..dc644b0 100644
--- a/story.json
+++ b/story.json
@@ -44,6 +44,53 @@
]
},
{
+ "quest_id": 3,
+ "pre_dialog": [
+ ],
+ "post_dialog": [
+ {
+ "bg": "forest_sunset",
+ "left_sprite": "0",
+ "center_sprite": "giulio",
+ "right_sprite": "0",
+ "name": "Giulio",
+ "message": "Things seems to be getting difficult, aren't they...? Can't you do anything?"
+ },
+ {
+ "bg": "forest_sunset",
+ "left_sprite": "giulio",
+ "center_sprite": "0",
+ "right_sprite": "archmage",
+ "name": "Mage?",
+ "message": "Damn, I'll be late at this rate... Wait, arent you a mana mage? Your knight seems pretty beat up, are you using the spheres properly?"
+ },
+ {
+ "bg": "forest_sunset",
+ "left_sprite": "giulio",
+ "center_sprite": "0",
+ "right_sprite": "archmage",
+ "name": "Mage?",
+ "message": "If you {color=#0f0}tap on the sphere{/color}, you can switch its place with any other sphere or empty space."
+ },
+ {
+ "bg": "forest_sunset",
+ "left_sprite": "giulio",
+ "center_sprite": "0",
+ "right_sprite": "archmage",
+ "name": "Mage?",
+ "message": "Now, you must excuse me, kid. Make sure to give the attack spheres to your damage dealers, and you'll be improving your performance in no time!"
+ },
+ {
+ "bg": "forest_sunset",
+ "left_sprite": "0",
+ "center_sprite": "giulio",
+ "right_sprite": "0",
+ "name": "Giulio",
+ "message": "...That was a strange man. {color=#0f0}Tapping on the spheres{/color}, wasn't it? You should try it on the next fight."
+ }
+ ]
+ },
+ {
"quest_id": 5,
"pre_dialog": [
{
@@ -67,10 +114,34 @@
},
{
"quest_id": 6,
- "pre_dialog": "SQ00006_pre"
+ "pre_dialog": "SQ00006_pre",
+ "post_dialog": [
+ {
+ "bg": "humancity",
+ "left_sprite": "0",
+ "center_sprite": "archmage",
+ "right_sprite": "0",
+ "name": "Mage?",
+ "message": "Hey, you also arrived here! Did you knew the {color=#0f0}cog icon{/color} on combat allows you to change the summon?"
+ },
+ {
+ "bg": "humancity",
+ "left_sprite": "0",
+ "center_sprite": "archmage",
+ "right_sprite": "0",
+ "name": "Mage?",
+ "message": "...We can talk later, the second wave approaches. They'll not stand against my lightning!"
+ }
+ ]
+ },
+ {
+ "quest_id": 7,
+ "pre_dialog": [],
+ "post_dialog": "SQ00007_post"
},
{
"quest_id": 10,
+ "pre_dialog": [],
"post_dialog": "SQ00010_post"
}
]