Skip to content

Commit

Permalink
Merge pull request #135 from esoviscode/character_creation
Browse files Browse the repository at this point in the history
Character creation
  • Loading branch information
Cellmer authored Mar 12, 2023
2 parents b3f62f2 + 0cdc652 commit 85cb5cf
Show file tree
Hide file tree
Showing 9 changed files with 722 additions and 21 deletions.
183 changes: 183 additions & 0 deletions dnd-bot/dnd_bot/dc/ui/message_templates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import nextcord

from dnd_bot.logic.character_creation.chosen_attributes import ChosenAttributes
from dnd_bot.logic.prototype.creature import Creature
from dnd_bot.logic.prototype.multiverse import Multiverse
from dnd_bot.logic.prototype.player import Player
Expand Down Expand Up @@ -146,3 +147,185 @@ def player_turn_embed(player: Player, active_player: Player, active_user_icon=No
def end_turn_recent_action_message(ending_creature):
return f"{ending_creature.name} has ended their turn"

@staticmethod
def character_creation_start_message_template():
"""embed at the beginning of character creation process"""

desc = "In the following forms you will be able to create the character for this game.\n\n" \
" Some of the attributes like name, backstory and alignment are just for you in order to immerse" \
" better with your character. \n\n" \
"The other ones: especially race and class can have a direct impact on" \
" your future interactions and attributes "

embed = nextcord.Embed(title=f'Character Creation', description=desc)

return embed

@staticmethod
def alignment_form_view_message_template():
"""embed in character creation explaining alignment"""

desc = "Alignment is a categorization of the ethical and moral perspective of your character.\n\n"
desc += "The nine alignments can be described as follows: \n"

embed = nextcord.Embed(title=f'Alignment Form', description=desc)

embed.add_field(name="Lawful Good",
value="A lawful good character typically acts with compassion and always with honor and a "
"sense of duty. However, lawful good characters will often regret taking any action "
"they fear would violate their code, even if they recognize such action as being good.")

embed.add_field(name="Neutral good",
value="A neutral good character typically acts altruistically, without regard for or against "
"lawful precepts such as rules or tradition. A neutral good character has no problems "
"with cooperating with lawful officials, but does not feel beholden to them. In the "
"event that doing the right thing requires the bending or breaking of rules, "
"they do not suffer the same inner conflict that a lawful good character would.")

embed.add_field(name="Chaotic good",
value="A chaotic good character does what is necessary to bring about change for the better, "
"disdains bureaucratic organizations that get in the way of social improvement, "
"and places a high value on personal freedom, not only for oneself, but for others as "
"well. Chaotic good characters usually intend to do the right thing, but their methods "
"are generally disorganized and often out of sync with the rest of society.")

embed.add_field(name="Lawful neutral",
value="A lawful neutral character typically believes strongly in lawful concepts such as "
"honor, order, rules, and tradition, but often follows a personal code in addition to, "
"or even in preference to, one set down by a benevolent authority.")

embed.add_field(name="True neutral",
value="A neutral character (also called \"true neutral\") is neutral on both axes and tends "
"not to feel strongly towards any alignment, or actively seeks their balance.")

embed.add_field(name="Chaotic neutral",
value="A chaotic neutral character is an individualist who follows their own heart and "
"generally shirks rules and traditions. Although chaotic neutral characters promote the "
"ideals of freedom, it is their own freedom that comes first; good and evil come second "
"to their need to be free.")

embed.add_field(name="Lawful evil",
value="A lawful evil character sees a well-ordered system as being easier to exploit than to "
"necessarily follow.")

embed.add_field(name="Neutral evil",
value="A neutral evil character is typically selfish and has no qualms about turning on "
"allies-of-the-moment, and usually makes allies primarily to further their own goals. A "
"neutral evil character has no compunctions about harming others to get what they want, "
"but neither will they go out of their way to cause carnage or mayhem when they see no "
"direct benefit for themselves. Another valid interpretation of neutral evil holds up "
"evil as an ideal, doing evil for evil's sake and trying to spread its influence.")

embed.add_field(name="Chaotic evil",
value="A chaotic evil character tends to have no respect for rules, other people's lives, "
"or anything but their own desires, which are typically selfish and cruel. They set a "
"high value on personal freedom, but do not have much regard for the lives or freedom "
"of other people. Chaotic evil characters do not work well in groups because they "
"resent being given orders and usually do not behave themselves unless there is no "
"alternative.")

return embed

@staticmethod
def class_form_view_message_template():
"""embed in character creation explaining classes"""

desc = "A character class is a fundamental part of the identity and nature of characters.\n" \
"Their capabilities, strengths, and weaknesses are largely defined by their class\n\n "

desc += "Available classes are described below: \n"

embed = nextcord.Embed(title=f'Class Form', description=desc)

embed.add_field(name="Warrior ⚔",
value="Warriors share an unparalleled mastery with weapons and armor, and a thorough "
"knowledge of the skills of combat. They are well acquainted with death, both meting it "
"out and staring it defiantly in the face.")

embed.add_field(name="Mage 🧙",
value="Mages are supreme magic-users, defined and united as a class by the spells they cast. "
"Drawing on the subtle weave of magic that permeates the cosmos, mages cast spells of "
"explosive fire, arcing lightning, subtle deception, brute-force mind control, "
"and much more.")

embed.add_field(name="Ranger 🏹",
value="Far from the bustle of cities and towns, past the hedges that shelter the most distant "
"farms from the terrors of the wild, amid the dense-packed trees of trackless forests "
"and across wide and empty plains, rangers keep their unending watch.")

return embed

@staticmethod
def race_form_view_message_template():
"""embed in character creation explaining races"""

desc = "Each race has a distinct appearance, behavior and often range of statistics associated with it.\n\n "

desc += "Available races are described below: \n"

embed = nextcord.Embed(title=f'Race Form', description=desc)

embed.add_field(name="Human 👨",
value="In the reckonings of most worlds, humans are the youngest of the common races, "
"late to arrive on the world scene and short-lived in comparison to dwarves, elves, "
"and dragons. Perhaps it is because of their shorter lives that they strive to achieve "
"as much as they can in the years they are given. Or maybe they feel they have "
"something to prove to the elder races, and that's why they build their mighty empires "
"on the foundation of conquest and trade. Whatever drives them, humans are the "
"innovators, the achievers, and the pioneers of the worlds.")

embed.add_field(name="Elf 🧝",
value="Elves are a magical people of otherworldly grace, living in places of ethereal beauty, "
"in the midst of ancient forests or in silvery spires glittering with faerie light, "
"where soft music drifts through the air and gentle fragrances waft on the breeze. Elves "
"love nature and magic, art and artistry, music and poetry.")

embed.add_field(name="Dwarf 🤏",
value="Kingdoms rich in ancient grandeur, halls carved into the roots of mountains, "
"the echoing of picks and hammers in deep mines and blazing forges, a commitment to "
"clan and tradition, and a burning hatred of goblins and orcs – these common threads "
"unite all dwarves.")

return embed

@staticmethod
def stats_retrospective_form_view_message_template(user_id):
"""embed showing created character and his stats"""

character = ChosenAttributes.chosen_attributes[user_id]

embed = nextcord.Embed(title=f'Your Character')

embed.add_field(name="Name",
value=character['name'],
inline=False)

embed.add_field(name="Backstory",
value=character['backstory'],
inline=False)

embed.add_field(name="Alignment",
value='-'.join(character['alignment']),
inline=False)

embed.add_field(name="Class",
value=character['class'],
inline=False)

embed.add_field(name="Race",
value=character['race'],
inline=False)

embed.add_field(name="Stats",
value=f"HP: {character['hp']} \n"
f"Strength: {character['strength']}\n"
f"Dexterity: {character['dexterity']}\n"
f"Intelligence: {character['intelligence']}\n"
f"Charisma: {character['charisma']}\n"
f"Perception: {character['perception']}\n"
f"Initiative: {character['initiative']}\n"
f"Action points: {character['action points']}\n",
inline=False)

return embed

Loading

0 comments on commit 85cb5cf

Please sign in to comment.