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

Remove Hard Coding for Focus Karma Costs #5131

Open
Teksura opened this issue Apr 18, 2024 · 3 comments
Open

Remove Hard Coding for Focus Karma Costs #5131

Teksura opened this issue Apr 18, 2024 · 3 comments
Labels

Comments

@Teksura
Copy link
Contributor

Teksura commented Apr 18, 2024

Is your feature request related to a problem? Please describe.
Presently, Focus Karma Costs are hard coded and set in the settings file. This is actually kind of obnoxious, as it makes it difficult to add new Foci.

Describe the solution you'd like
I'd like to be able to set something in the XML akin to the following:

    <gear>
      <id>62bfb38d-5515-440b-83ed-289ed926d27e</id>
      <name>Power Focus</name>
      <category>Foci</category>
      <rating>18</rating>
      <source>SR5</source>
      <page>319</page>
      <avail>(Rating * 4)R</avail>
      <bonus>
        <skillattribute precedence="0">
          <name>MAG</name>
          <bonus>Rating</bonus>
        </skillattribute>
        <selecttradition />
      </bonus>
      <cost>Rating * 18000</cost>
      <boundfocicost>Rating * 6</boundfocicost>
    </gear>

The presence of <boundfocicost> indicates that the Gear should be treated as a Foci, and that it should be possible to bind. This removes Foci from being hard coded and instead allows technically any gear to be treated as a Foci. This allows a larger range of customization for Foci costs and makes it significantly easier to create custom foci.

@Teksura
Copy link
Contributor Author

Teksura commented May 6, 2024

And incidentally, this also works with Individualized foci by just doing a little math:

<boundfocicost>(Rating * 6) - 2</boundfocicost>

which means those won't need hard coded, either.

@Teksura
Copy link
Contributor Author

Teksura commented May 17, 2024

Having thought about it a bit more, it might be useful to also leave room to add Plugins which also have a karma cost (especially one which can take the cost from the parent) such as an Imbue Item case.

I can handle all the XML side of it if the C# is done by someone who knows C#

@chummer5a
Copy link
Owner

Implemented in
https://github.com/chummer5a/chummer5a/tree/feature/focuskarmacost
Weapon focus would be
(({Rating} * 3) * {karmabindmultiplier}) + {karmabindextracost}
where
{Rating} == focus rating
{karmabindmultiplier} == multiplier provided by improvements
{karmabindextracost} == karma point values added/removed by improvements

Also added addimprovementsoncreate to the bonus node which prevents the bonus node from adding improvements when the object is created, we currently use categories for that.

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

No branches or pull requests

3 participants