mirror of
https://github.com/wr34k/IRCUFC.git
synced 2024-11-25 00:46:39 +00:00
Ground game!
This commit is contained in:
parent
4993f405b4
commit
69c7f0de1f
@ -117,9 +117,9 @@ class Fight(object):
|
|||||||
else:
|
else:
|
||||||
for f in self.fighters:
|
for f in self.fighters:
|
||||||
if f.nick == nick:
|
if f.nick == nick:
|
||||||
self.IRC.privmsg(nick, "[{}] Status for {} -> Current health: {} | Current stance: {} | Next action: {}".format(self.IRC.mirc.color("*", self.IRC.mirc.colors.GREEN), f.nick, int(f.hp), f.stance, f.nextAction))
|
self.IRC.privmsg(nick, "[{}] Status for {} -> Current health: {} | Current stance: {} {} | Next action: {}".format(self.IRC.mirc.color("*", self.IRC.mirc.colors.GREEN), f.nick, int(f.hp), f.stance, f.groundPos if f.groundPos else "", f.nextAction if f.nextAction else ""))
|
||||||
else:
|
else:
|
||||||
self.IRC.privmsg(nick, "[{}] Status for {} -> Current health: {} | Current stance: {}".format(self.IRC.mirc.color("*", self.IRC.mirc.colors.GREEN), f.nick, int(f.hp), f.stance))
|
self.IRC.privmsg(nick, "[{}] Status for {} -> Current health: {} | Current stance: {} {}".format(self.IRC.mirc.color("*", self.IRC.mirc.colors.GREEN), f.nick, int(f.hp), f.stance, f.groundPos if f.groundPos else ""))
|
||||||
|
|
||||||
|
|
||||||
def fightOver(self):
|
def fightOver(self):
|
||||||
@ -174,19 +174,22 @@ class Fight(object):
|
|||||||
|
|
||||||
|
|
||||||
def get_next_move_data(self, f, e):
|
def get_next_move_data(self, f, e):
|
||||||
dmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['dmgidx']
|
if f.stance == e.stance == 'ground':
|
||||||
mindmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['mindmg']
|
dmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance][e.groundPos]['dmgidx']
|
||||||
blockidx = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['blockidx']
|
mindmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance][e.groundPos]['mindmg']
|
||||||
fallchance = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['fallchance'] \
|
blockidx = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance][e.groundPos]['blockidx']
|
||||||
if 'fallchance' in self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance] \
|
fallchance = 0
|
||||||
else 0
|
texts = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance][e.groundPos]['text']
|
||||||
standchance = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['standchance'] \
|
else:
|
||||||
if 'standchance' in self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance] \
|
dmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['dmgidx']
|
||||||
else 0
|
mindmg = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['mindmg']
|
||||||
|
blockidx = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['blockidx']
|
||||||
|
fallchance = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['fallchance'] \
|
||||||
|
if 'fallchance' in self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance] \
|
||||||
|
else 0
|
||||||
|
texts = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['text']
|
||||||
|
|
||||||
texts = self.config['moves'][f.stance][f.nextAction[0]][f.nextAction[1]][e.stance]['text']
|
return dmg, mindmg, blockidx, fallchance, texts
|
||||||
|
|
||||||
return dmg, mindmg, blockidx, fallchance, standchance, texts
|
|
||||||
|
|
||||||
def attack(self):
|
def attack(self):
|
||||||
roll1 = roll2 = 0
|
roll1 = roll2 = 0
|
||||||
@ -221,10 +224,19 @@ class Fight(object):
|
|||||||
attacker.advantage = True
|
attacker.advantage = True
|
||||||
defender.advantage = False
|
defender.advantage = False
|
||||||
|
|
||||||
|
if attacker.stance == defender.stance == 'ground':
|
||||||
|
if attacker.groundPos == 'below':
|
||||||
|
attacker.groundPos = 'above'
|
||||||
|
defender.groundPos = 'below'
|
||||||
|
self.shout("{} Manage to get above {}!".format( \
|
||||||
|
self.IRC.mirc.color(attacker.nick, attacker.colour), \
|
||||||
|
self.IRC.mirc.color(defender.nick, defender.colour) \
|
||||||
|
))
|
||||||
|
|
||||||
if attacker.nextAction[0] == 'standup':
|
if attacker.nextAction[0] == 'standup':
|
||||||
standchance = self.config['moves'][attacker.stance]['standup'][defender.stance]['chance']
|
standchance = self.config['moves'][attacker.stance]['standup'][defender.stance]['chance']
|
||||||
else:
|
else:
|
||||||
dmg, mindmg, blockidx, fallchance, standchance, texts = self.get_next_move_data(attacker, defender)
|
dmg, mindmg, blockidx, fallchance, texts = self.get_next_move_data(attacker, defender)
|
||||||
|
|
||||||
txt = self.prettyTxt(attacker, defender, texts)
|
txt = self.prettyTxt(attacker, defender, texts)
|
||||||
self.shout("{}".format(txt))
|
self.shout("{}".format(txt))
|
||||||
@ -250,6 +262,10 @@ class Fight(object):
|
|||||||
|
|
||||||
if (random.random() * 100) < fallchance: # defender falls down?
|
if (random.random() * 100) < fallchance: # defender falls down?
|
||||||
defender.stance = 'ground'
|
defender.stance = 'ground'
|
||||||
|
if attacker.stance == 'ground':
|
||||||
|
defender.groundPos = 'above'
|
||||||
|
else:
|
||||||
|
defender.groundPos = 'below'
|
||||||
falltxt = self.prettyTxt(attacker, defender, self.config['info']['stand2ground'])
|
falltxt = self.prettyTxt(attacker, defender, self.config['info']['stand2ground'])
|
||||||
self.shout("{}".format(falltxt))
|
self.shout("{}".format(falltxt))
|
||||||
|
|
||||||
@ -266,8 +282,11 @@ class Fight(object):
|
|||||||
|
|
||||||
|
|
||||||
if attacker.nextAction[0] == 'standup': # attacker gets up?
|
if attacker.nextAction[0] == 'standup': # attacker gets up?
|
||||||
if (random.random() * 100) < standchance: # DO you get up?
|
if (random.random() * 100) < standchance:
|
||||||
attacker.stance = 'stand'
|
attacker.stance = 'stand'
|
||||||
|
attacker.groundPos = None
|
||||||
|
if defender.stance == 'ground' and defender.groundPos == 'above':
|
||||||
|
defender.groundPos = 'below'
|
||||||
standtxt = self.prettyTxt(attacker, defender, self.config['info']['ground2stand'])
|
standtxt = self.prettyTxt(attacker, defender, self.config['info']['ground2stand'])
|
||||||
self.shout("{}".format(standtxt))
|
self.shout("{}".format(standtxt))
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ class Fighter(object):
|
|||||||
|
|
||||||
self.hp = 100
|
self.hp = 100
|
||||||
self.stance = 'stand'
|
self.stance = 'stand'
|
||||||
|
self.groundPos = None
|
||||||
|
|
||||||
self.nextAction = None
|
self.nextAction = None
|
||||||
|
|
||||||
|
@ -128,7 +128,12 @@
|
|||||||
"chance": 20
|
"chance": 20
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"chance": 70
|
"above": {
|
||||||
|
"chance": 10
|
||||||
|
},
|
||||||
|
"below": {
|
||||||
|
"chance": 85
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"kick": {
|
"kick": {
|
||||||
@ -143,12 +148,22 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"dmgidx": 40,
|
"above": {
|
||||||
"mindmg": 23,
|
"dmgidx": 20,
|
||||||
"blockidx": 42,
|
"mindmg": 11,
|
||||||
"text": [
|
"blockidx": 66,
|
||||||
"%attacker% hit %defender% with huge kneel kicks to the head!"
|
"text": [
|
||||||
]
|
"%attacker% hit %defender% with kneel kicks to the head from below"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"below": {
|
||||||
|
"dmgidx": 40,
|
||||||
|
"mindmg": 23,
|
||||||
|
"blockidx": 42,
|
||||||
|
"text": [
|
||||||
|
"%attacker% hit %defender% with huge kneel kicks to the head!"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"middle": {
|
"middle": {
|
||||||
@ -162,12 +177,22 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"dmgidx": 25,
|
"above": {
|
||||||
"mindmg": 17,
|
"dmgidx": 13,
|
||||||
"blockidx": 48,
|
"mindmg": 9,
|
||||||
"text": [
|
"blockidx": 70,
|
||||||
"%attacker% hit %defender% with kneel kicks to the body"
|
"text": [
|
||||||
]
|
"%attacker% hit %defender% with kneel kicks to the body for below"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"below": {
|
||||||
|
"dmgidx": 25,
|
||||||
|
"mindmg": 17,
|
||||||
|
"blockidx": 48,
|
||||||
|
"text": [
|
||||||
|
"%attacker% hit %defender% with kneel kicks to the body"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"low": {
|
"low": {
|
||||||
@ -181,12 +206,22 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"dmgidx": 15,
|
"above": {
|
||||||
"mindmg": 2,
|
"dmgidx": 7,
|
||||||
"blockidx": 40,
|
"mindmg": 2,
|
||||||
"text": [
|
"blockidx": 65,
|
||||||
"%attacker% hit %defender% with kneel kicks to the legs"
|
"text": [
|
||||||
]
|
"%attacker% hit %defender% with kneel kicks to the legs from below"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"below": {
|
||||||
|
"dmgidx": 15,
|
||||||
|
"mindmg": 2,
|
||||||
|
"blockidx": 40,
|
||||||
|
"text": [
|
||||||
|
"%attacker% hit %defender% with kneel kicks to the legs"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
1
assets/palmares.json
Normal file
1
assets/palmares.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"wr34k": {"wins": 1, "looses": 0}, "wreek": {"wins": 0, "looses": 1}}
|
0
assets/palmares.json.bkp
Normal file
0
assets/palmares.json.bkp
Normal file
Loading…
Reference in New Issue
Block a user