Code Monkey home page Code Monkey logo

Comments (5)

erodozer avatar erodozer commented on May 25, 2024

Might be good to define commands as a resource type that you can attach to things. This could allow you to more easily define commands that can be shared across multiple types, such as items that can cast magic for characters who can't typically use magic, as well as define monster AI rules that allow them to select their move from a provided list of commands.

from godot-open-rpg.

NathanLovato avatar NathanLovato commented on May 25, 2024

Agreed with @nhydock ! Attack is already a CombatAction, and there's a base class to use for actions in general. I'm not sure how to best implement each specific action so suggestions welcome.

I would definitely have skills and items as Resources. I would also have the element hold a method that does the action. E.g. for a HealingPotion:

func use(target):
    # healing code and checks
    target.stats.health += HEALING_POWER

It makes sense for the potion itself to heal or the lightning strike to damage the opponent. Although there may be shortcomings to this approach I can't see now.

from godot-open-rpg.

MarianoGnu avatar MarianoGnu commented on May 25, 2024

FYI I'm working on this issue

from godot-open-rpg.

erodozer avatar erodozer commented on May 25, 2024

@MarianoGnu I was looking at this this morning as well to spruce up how skills are implemented and have some ideas. Will push up some code to my fork in a few hours if you want to have a look at what I was thinking.

from godot-open-rpg.

MarianoGnu avatar MarianoGnu commented on May 25, 2024

@nhydock already created the PR, take a look if it's mor or less what you was thinking of.

from godot-open-rpg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.