Author Topic: [EXPANSION]Hardmode Expansion -- General Feedback Thread  (Read 459009 times)

Offline hellrazor

  • Moderator
  • Commander
  • ***
  • Posts: 2065
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: [EXPANSION]Hardmode Expansion -- General Feedback Thread
« Reply #915 on: March 02, 2025, 05:14:57 am »
The closest thing to case matching would be with nested else cases like so
Code: [Select]
  scripts:
#BEGIN ADJUSTED SELL PRICE BY DIFFICULTY
    sellCostItem:
      - offset: 3
        code: |
          var int temp;
          geoscape_game.difficultyLevel temp;  # get difficulty

          if le temp DIFF_EXPERIENCED; # For BEGINNER and EXPERIENCED
            item_rule.getTag temp Tag.SELL_PRICE_BE;  # custom item sell price
          else le temp DIFF_GENIUS; # For VETERAN and GENIUS
            item_rule.getTag temp Tag.SELL_PRICE_VG;  # custom item sell price
          else; # For SUPERHUMAN
            set temp 0;
          end;

          if neq temp 0;
            set cost_current temp;
          end;

          return cost_current;
#END ADJUSTED SELL PRICE BY DIFFICULTY

Absorbed, will test this but should work.

I've also changed to check to lower or equal instead of just equal, this way the starting 'if' looks for both beginner and experienced, the first 'else' then checks for veteran or genius, tecnically it would also look for the other 2 lower difficulties, but since those are covered in the initial 'if' they aren't a factor at this point. In addition I've extracted the temp check to it's own exterior check so you don't have include it in every previous 'if' or 'else'. Did have to add a 2nd 'else' for SH with my change otherwise 'temp' would of remained with a value of 4 and mess up the return cost.

Jeah that sounds right. I take it thanks.

In addition, depending on how you would rather approach it, instead of manually setting the prices you could use the factor you want to use and put this in the script
Code: [Select]
            muldiv cost_current temp 1000;
before returning it. The factor would have to be in an integer format, so using your example in the code for beginner, set it to 1786 and divide by 1000. You could also add a tag for the divider so you can customize the precision per item, but that does mean more tags to read in the script and manually set in the rules.

A factor won't do.  I only wanna change prices for Items which are effected by different spawn numbers, meaning Weapons and Items the aliens carry and their corpse and alive sales values.
So a list with specific items is the only way.

Online CrazedHarpooner

  • Colonel
  • ****
  • Posts: 174
    • View Profile
Re: [EXPANSION]Hardmode Expansion -- General Feedback Thread
« Reply #916 on: March 02, 2025, 11:59:28 am »
Quote
A factor won't do.  I only wanna change prices for Items which are effected by different spawn numbers, meaning Weapons and Items the aliens carry and their corpse and alive sales values.
So a list with specific items is the only way.
I didn't mean it as a global factor for everything, but a factor per item. While I'm sure different items will need their own adjustment others would probably share a very similar factor, let's say the whole plasma weapons using the same 1.7 (aprox) for the lower levels, while let's say lasers using a different one. True that the workload wouldn't be that much different other than saving yourself from calculating the exact prices needed to be listed per item, so the value of this suggestion is very circumstantial.