Coder Social home page Coder Social logo

dynamictariffs's Introduction

Dynamic Tariffs

This is a utility mod for Starsector that dynamically changes tariffs based on your current reputation with the faction that owns the market.

How it works

When you open a market, an event is fired that will then modify the tariffs based on the parameters in the settings.json (read about that below), when you close a market, all modifications will be removed as to maintain utility status.

Settings.json

  • dt_percents defines what tariffs should be at each level of reputation from Suspicious to Cooperative.
  • dt_granular if set true will offer all values in-between the set percents based on your actual reputation level. Note: if set true, if you reach 100 reputation with a faction your tariffs will be 0%.
  • dt_commission if enabled will give you a discount when commissioned with the market's owning faction.
  • dt_commDiscount is how much it should discount (default is 5%)
  • dt_usewhitelist is whether or not you want to use the whitelist at all. It is enable by default.
  • dt_whitelist contains all of the vanilla market id's, these will be the only markets that are effected, if you wish to add some markets, just add their market id's to the list.

Stock settings

Reputation Tariff
Suspicious 30%
Neutral 25%
Favorable 20%
Welcoming 15%
Friendly 10%
Cooperative 5%

And if you are commissioned with the faction, it will be lowered an additional 5%. (This can be turned off in the settings.json with dt_commission:false)

Also, It doesn't go below "Suspicious" because you can't trade with factions below that reputation level.

Thanks

Huge thanks to the folks in discord including: LazyWizard, stormbringer951, extremely loweffort art god, Ω Rubin Ω, and Jaghaimo (for the capital P in modPlugin).

This is my first mod for this game, and my first time using Java since high school, they helped A LOT.

Current Workflow setup

  • I am using VSCode in Windows with the Project Manager for Java plugin.
  • I'm using the Java JDK 1.7.0_80 from the Java archive on Oracles website.

dynamictariffs's People

Contributors

jsbursik avatar

Stargazers

 avatar  avatar

Watchers

 avatar

dynamictariffs's Issues

Vortex mod manager can't install

I've downloaded the 2.0 zip file, and tried to add it with Vortex, here's the error I get:

image

I have no idea why, I can unzip it and see the mod_info.json file just fine...

Tariff not being set correctly when dt_commission = true, dt_granular = true and maximum reputation

When I trade with a faction that I have a commission with the tariff change works fine until I get to maximum reputation with that faction.
I checked through the code and I suspect line 104 in TariffUtil.java:

tariff = tariff < 0f ? -0.3f : tariff;

I think tariff should be set to 0f instead of -0.3f when it is less than 0 at that step so it will correctly set tariffs to 0 in the following steps.

I debugged it locally and it seems to work fine after the change.

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.