Skip to main content

A module for creating and managing rpg characters.

Project description

CharActor

Description

CharActor provides a convenient collection of character-based operations. It allows you to easily create, modify and employ characters in a variety of different ways.

Installation

pip install CharActor

Usage

from CharActor import character_bank, create

# Create a randomized character
character = create()

# Create a character with a specific name
character = create(name='John Doe')

# Create a character with a specific object name, character name, race, role, background and alignment
character = create('my_character', 'John Doe', 'Human', 'Fighter', 'Noble', 'Lawful Good')

# Access any of the characters
my_character = character_bank.my_character

# Access any of the characters' attributes
my_character.name # 'John Doe'
my_character.Strength # Str: 17 (+3)

Characters

A character object contains a variety of attributes/methods which tend to differ from character to character.

Attributes

  • name
  • _role (e.g my_character.Fighter)
  • _race (e.g my_character.Human)
  • _background (e.g my_character.Noble)
  • _alignment (e.g my_character.LawfulGood)
  • age
  • Strength
  • Dexterity
  • Constitution
  • Intelligence
  • Wisdom
  • Charisma
  • actions
  • armor_class
  • character_sheet (e.g print(my_character.character_sheet))
  • entity_id
  • experience
  • hp
  • initiative
  • inventory
  • level
  • saving_throws
  • skill_points
  • skillbook
  • speed
  • target

Methods

  • attack
  • look_around
  • move
  • pickup
  • saving_throw
  • end_turn

Character Bank

The character bank is a collection of all the characters that have been created. It is a dictionary of character objects, with the key being the name of the character. More conveniently, the character bank also allows you to access the characters as attributes. A saving system(using python's pickle) is currently under development. Until then your character's are only saved for the duration of the program.

from CharActor import character_bank, create

# Create a character
character = create('my_character')

# Access the character
my_character = character_bank.my_character
print(my_character.character_sheet)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Support

If you like this project or are just feeling generous, consider buying me a coffee.

buymeacoffee

Project details


Release history Release notifications | RSS feed

This version

0.5.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CharActor-0.5.4.tar.gz (59.0 kB view details)

Uploaded Source

File details

Details for the file CharActor-0.5.4.tar.gz.

File metadata

  • Download URL: CharActor-0.5.4.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0b4+

File hashes

Hashes for CharActor-0.5.4.tar.gz
Algorithm Hash digest
SHA256 7db978e17611919e165c8dd3223c588fa708d770bad5cfb79183f80c47bfef9a
MD5 31992b3dc39d7f5f6d83513c7b6eec39
BLAKE2b-256 43bc407f8df95c551b3f3de357c0dae9ba3ea7149f47a043cb56fb25002ef0f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page