python-consolegame-wizardsduel's Issues
FIX #2
Guess I've had enough for today.
stunned_rounts
=> stunned_rounds
...
Wrong intro message (spell speed description)
intro_welcome_message()
currently states:
3- SPEED: If both players succesfully cast a spell, the spell with the greatest speed will succeed and the other one will not
This is not true; initially it was but now the fastest spell is just executed first.
Improvement: Use dictionaries
Instead of all seperate spell_x
and wand_x
objects, use dictionaries.
This makes more sense (why didn't I think of it earlier? [thnx tgrtim :)]), especially in the sense if importing them (and not having both the objects ánd a list holding those objects)
Fetching help from single spell returns list
When using help SPELL_NAME
, a list is returned containing both the actual info, and 0
(levenshtein distance, which is always 0 in this scenario).
Should print spell[0]
in https://github.com/KW46/Python-ConsoleGame-WizardsDuel/blob/development/game.py#L49
Stunned rounds incorrect value (off by one)
When a player gets stunned (/silenced), they are immidiately un-stunned the next move (if they were stunned for 1 move).
This happens because round_end()
decreases player.stunned_rounds
by one, which happens after .stunned_rounds
is set without any checks.
Easiest fix would be to increase stunned_rounds by one
AttributeError for `stunned_moves`
In player.cast_spell()
, lines 137-152
.stuned_moves
is used instead of .stunned_rounds
Improvement: Seperate rounds and entry, more explicit imports
Make the entry file more of an entry file.
Makes the code better readable and should make handling exceptions easier.
Improvement: Type annotation for function return types and eventually variables
Add return types to functions, like so: def add(x: int, y: int) -> int:
They can be added to variables too: my_integer: int = 1
It doesn't actually enforce types but useful nonetheless
Improvement: Documentation
Ensure (even though nobody will ever actually use this) stuff is documented
Stunned player can sometimes still perform spells / EDIT: protego succeeds even if failed
If a stunned player is the fastest_caster, it somehow sometimes still allows the stunned player to perform their spell.
player.py:68-70
(cast_spell()
)
if self.stunned_rounds > 0 and self.active_spell != spell_finite_incantatem:
print("<!> {name} tries to cast a spell but fails because they are stunned!".format(name=self.name))
return
Kwarde casted 'Sectumsempra' with succes
Traxyy tried to cast 'Protego' but mispronounced it. Cast FAILED!
- Kwarde casts sectumsempra on Traxyy. FAILURE! Traxyy blocks the attack!
<!> Round 3 ended! Current stats:
- Kwarde: Health: 1000 | Queued effects: None | Round being stunned: 0
- Traxyy: Health: 1000 | Queued effects: None | Rounds being stunned: 1
== Round 3 ==
Kwarde, it's your turn to enter a spell: Stupefy
Traxyy, how will you obliviate your opponent? Silencio
Kwarde casted 'Stupefy' with succes
Traxyy casted 'Silencio' with succes
- Kwarde's spell speed is 95. Traxyy's spell speed is 35. Kwarde is the fastest caster this round!
- Kwarde casts stupefy on Traxyy causing 75 damage!
<!> Traxyy tries to cast a spell but fails because they are stunned!
<!> Round 4 ended! Current stats:
Player.cast_spell_result()
should not call a succes message if the player is stunned because that's confusing- In round 3, Traxyy tried to cast
Protego
but failed, yet the attack was succesfully blocked:Player.cast_spell_result()
should set.active_spell
tospell_none
to preventPlayer.cast_spell()
thinking the spell was still cast. - ^This would thus also happen if player is not stunned
- In round 3, it appears as if
Player.cast_spell()
did nothing for Traxyy. Expected<!> Traxyy tries to cast a spell but fails because they are stunned!
. Need to figure out why
EDIT:
Confirmed (missing contect, so clarifying: 'Kwarde' was not stunned at the time)
Kwarde tried to cast 'Protego' but mispronounced it. Cast FAILED!
Traxyy casted 'Rictusempra' with succes
- Traxyy casts rictusempra on Kwarde. FAILURE! Kwarde blocks the attack!
Game doesn't end as long as someone is stunned
Currently, the game checks if a player's health is 0 at the end of each round (note: not in end_round()
)
However, this round can end earlier (in the code) if only one of the two players was succesful in casting a spell (# > Determine instant winner or skip to next round
). So actually the title is a bit inaccurate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.