def switch(): base.gameON() if (base.gameONcheck()): print base.gameONcheck() base.assignTargets() else: print base.gameONcheck() base.reset() return redirect(url_for("index"))
def index(): print "Game oN?" print base.gameONcheck() print "Users" base.printUsers() print "Data" base.printData() print base.gameONcheck() if 'username' in session: return render_template("index.html", corner=session['username']) return render_template("index.html")
def index(): print"Game oN?" print base.gameONcheck() print "Users" base.printUsers() print "Data" base.printData() print base.gameONcheck() if 'username' in session: return render_template ("index.html", corner = session['username']) return render_template ("index.html")
def kill(): if 'username' in session: if base.gameONcheck(): uid = base.getID(session['username']) tid = base.getTargetID(uid) lat1 = base.getLat(uid) long1 = base.getLong(uid) lat2 = base.getLat(tid) long2 = base.getLong(tid) #print lat1 #print long1 #print lat2 #print long2 if (base.killCheck(lat1, long1, lat2, long2)): base.kill(tid) if (base.checkWin(uid)): flash("You have won! Congrats!", "success") return redirect(url_for("switch")) else: base.assignTargets() flash( "You have killed your target! You have been assigned another target.", "success") return redirect(url_for("game")) else: flash("You have failed to kill your target.", "error") return redirect(url_for("game")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def kill(): if 'username' in session: if base.gameONcheck(): uid = base.getID(session['username']) tid = base.getTargetID(uid) lat1 = base.getLat(uid) long1 = base.getLong(uid) lat2 = base.getLat(tid) long2 = base.getLong(tid) #print lat1 #print long1 #print lat2 #print long2 if (base.killCheck (lat1, long1, lat2, long2)): base.kill(tid) if ( base.checkWin(uid)): flash ("You have won! Congrats!", "success") return redirect (url_for ("switch")) else: base.assignTargets() flash ("You have killed your target! You have been assigned another target.", "success") return redirect (url_for ("game")) else: flash ("You have failed to kill your target.", "error") return redirect (url_for ("game")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def game(): if 'username' in session: if base.gameONcheck(): print "BEFORE UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) if (base.checkStatus(uid)): return render_template("game.html", corner=session['username'], username=session['username'], target=base.getName(tid)) else: flash("You have been killed", "error") return redirect(url_for("index")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def game(): if 'username' in session: if base.gameONcheck(): print "BEFORE UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) if (base.checkStatus(uid)): return render_template ("game.html", corner = session['username'], username = session['username'], target = base.getName(tid)) else: flash ("You have been killed", "error") return redirect (url_for ("index")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def status(): if 'username' in session: if base.gameONcheck(): print "AFTER UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) print tid u = base.checkStatus(uid) t = base.checkStatus(tid) us = "" ts = "" if (u): us = "Alive" else: flash("You have been killed", "error") return redirect(url_for("index")) #us = "Dead" if (t): ts = "Alive" else: #flash ("Sorry, you have been killed") #return redirect (url_for("index")) ts = "Dead" #print u #print t return render_template("status.html", corner=session['username'], user_status=us, target_status=ts) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def status (): if 'username' in session: if base.gameONcheck(): print "AFTER UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) print tid u = base.checkStatus(uid) t = base.checkStatus(tid) us = "" ts = "" if (u): us = "Alive" else: flash ("You have been killed", "error") return redirect (url_for("index")) #us = "Dead" if (t): ts = "Alive" else: #flash ("Sorry, you have been killed") #return redirect (url_for("index")) ts = "Dead" #print u #print t return render_template ("status.html", corner = session['username'], user_status = us, target_status = ts) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))