Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize combat messaging for weapons #92

Open
feend78 opened this issue Jan 9, 2017 · 2 comments
Open

Customize combat messaging for weapons #92

feend78 opened this issue Jan 9, 2017 · 2 comments

Comments

@feend78
Copy link
Member

feend78 commented Jan 9, 2017

Currently, all weapons use the base Weapon typeclass's combat messaging. They are stored in an dict attribute called messages that has four keys for the four possible weapon attack outcomes.

  • dmg_hp - displayed when the weapon is used to damage the target's HP
  • dmg_sp - displayed when the weapon is used to damage the target's SP
  • dodged - displayed when the attack is dodged
  • missed - displayed when the attack misses

Here is a link to the messages' definition in the base typeclass: https://github.com/evennia/ainneve/blob/master/typeclasses/weapons.py#L29

To implement this, a messages key will need to be added to each weapon prototype in the prototypes_weapons.py file.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@stefanludlow
Copy link
Contributor

Spent some time working on this over the weekend, mainly pondering how best to do it. It's a touch beyond my skills, but if you could provide me with an example of what this would look like on the prototypes_weapons.py file, I'd be happy to fill this in for all the other records.

For my own notes, weapons.py line 29, rulebook.py 438

@feend78
Copy link
Member Author

feend78 commented Jan 23, 2017

@stefanludlow, here's an example:

HAND_AXE = {
    "key": "a hand axe",
    "aliases": ["hand axe", "axe"],
    "typeclass": "typeclasses.weapons.Weapon",
    "desc": "The blade of this axe appears well-used and slightly "
            "tarnished, but its handle is straight and sturdy.",
    "weight": 1,
    "value": 60*CC,
    "damage": 2,
    "range": "melee",
    "messages": {
            "dmg_hp": "{weapon} files silently through the air as {actor} slices {target} with its flashing blade.",
            "dmg_sp": "{actor} strikes {target} with the flat side of {weapon}, stunning them.",
            "dodged": "{weapon} fails to meet its target as {target} dodges {actor}'s attack.",
            "missed": "{actor} attacks {target} with {weapon} and misses."
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants