From 2e6e55a49906a00ff53f3b7aa078ae53aeaf4fcf Mon Sep 17 00:00:00 2001 From: wr34k Date: Fri, 29 Jun 2018 11:33:32 +0200 Subject: [PATCH] Fixing stuff + readme --- README.md | 39 ++++++++++++++++++++++++++++++++++++++- fight.py | 2 +- fighter.py | 1 - irc.py | 2 +- ircCommands.py | 10 ++++------ log.py | 6 +++--- 6 files changed, 47 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cf1e1d4..0ebe7ac 100644 --- a/README.md +++ b/README.md @@ -1 +1,38 @@ -# IRCUFC \ No newline at end of file +# IRCUFC +WORK IN PROGRESS + +IRC Game to let chatters having UFC like fights. + + +Connect to #IRCUFC @ Efnet and type !fight to register to the next fight + + +once 2 fighters will be registered, you'll reveice a list of actions possible for you to do in the next turn. + +To register an action for the next turn, simply use !action following by the action (ex: !action kick high) + +Once a fighter have no hp left, the fight is over. + + + + +If both fighters are attacking at the same time, then the one who will hit is random. There's still an slight advantage to the last player having hit. + +using 'block' will greatly increase the chance of blocking a hit. be careful though, if for instance you block high and your opponent attacks you low or middle, you'll have 100% chance of taking the hit. If you succeed to block a hit, you'll take the advantage for the next turn. + + +There's a chance for fighters to fall down. In this case, hits will be much less powerful, and your opponent will do huge damage. You'll have to use the 'standup' action in order to .. stand up :) This action will make you vulnerable to a hit. + + +TODO LIST: +Fix shitty code (!!!) +Add better output (Colors, formatting) +Add submissions +Add more strikes? (Superman punch, spinning kicks) +Add ascii art to display at each turn + +IDEAS: +Add a betting system, where spectators can bet for the next fight +Add XP system, where each fight let you get stronger / more resistant / get more moves + + diff --git a/fight.py b/fight.py index 3b43116..a1ea728 100644 --- a/fight.py +++ b/fight.py @@ -26,7 +26,7 @@ class Fight(object): self.fighters += [nick] if len(self.fighters) == 2: - self.IRC.privmsg(self.IRC.channel, "Alright {}, {}, let's fight!".format(self.fighters[0], self.fighters[1])) + self.IRC.privmsg(self.IRC.channel, "Alright. {}, {}, let's fight!".format(self.fighters[0], self.fighters[1])) self.state = 'fighters_ready' else: self.IRC.privmsg(self.IRC.channel, "Waiting for 2nd fighter...") diff --git a/fighter.py b/fighter.py index 003c168..1bb41c0 100644 --- a/fighter.py +++ b/fighter.py @@ -15,7 +15,6 @@ class Fighter(object): self.nextAction = None self.advantage = False - self.groundpos = None self.first_time_lowhp = True diff --git a/irc.py b/irc.py index 2f71ace..cf75b18 100644 --- a/irc.py +++ b/irc.py @@ -9,7 +9,7 @@ from ircReload import recompile from ircCommands import IrcCommands -server = 'irc.servercentral.net' +server = 'irc.underworld.no' port = 9999 channel = ('#IRCUFC', None) # (chan, key) use_ssl = True diff --git a/ircCommands.py b/ircCommands.py index 74a8e42..d68d63f 100644 --- a/ircCommands.py +++ b/ircCommands.py @@ -62,18 +62,16 @@ class IrcCommands(object): if self.fight.state == 'fighters_ready': self.fight.startFight() - else: - if cmd == 'status': - self.fight.getStatus(chan) - - - if self.fight.state == 'waiting_fighters_action': + elif self.fight.state == 'waiting_fighters_action': if cmd == 'action': if chan != self.IRC.channel: self.fight.set_next_action(nick, args) else: self.IRC.privmsg(self.IRC.channel, "{}".format(self.IRC.mirc.color("Not here retard your opponent can see your next move!", self.IRC.mirc.colors.LIGHTRED))) + else: + if cmd == 'status': + self.fight.getStatus(chan) self.IRC.flood_flag[chan] = False self.IRC.flood_count[chan] = 0 diff --git a/log.py b/log.py index 5c9f506..b1413aa 100644 --- a/log.py +++ b/log.py @@ -63,15 +63,15 @@ class Log(object): return "".join(a for a in args) def info(self, msg): - if not self.debug: + if self.debug: self.func( self.construct( "[", self.colors.fg.LIGHTGREEN, "*", self.colors.fg.DEFAULT, "] ", msg ) ) def warn(self, msg): - if not self.debug: + if self.debug: self.func( self.construct( "[", self.colors.fg.LIGHTYELLOW, "!", self.colors.fg.DEFAULT, "] ", msg ) ) def error(self, msg, exception=None): - if not self.debug: + if self.debug: self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", msg ) ) if exception: self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", str(exception) ) )