Author Topic: Change coins won/lost in the Fight minigame  (Read 1383 times)

0 Members and 2 Guests are viewing this topic.

CreeCyan

  • Youngling
  • *
  • Posts: 22
  • Karma: +0/-0
  • Let's go gaming!
    • View Profile
    • CreeCyan on Twitch
  • Twitch Name: CreeCyan
Change coins won/lost in the Fight minigame
« on: July 30, 2017, 10:33:00 AM »
Hey guys,
How do I change coins won and lost in the Fight mini game? I've looked at the channel commands that are used in the Fight mini game, and it looks like I'd have to change all the instances that say [>=||@rand@[1|50] to something like [>=||@rand@[10|500] if I wanted to increase the wins and losses by 10x, is that right?
twitch.tv/CreeCyan

Dante557

  • Advisor
  • Councilor
  • **
  • Posts: 555
  • Karma: +26/-0
  • Sometimes Helpful, Sometimes Not :D
    • View Profile
    • My Twitch Page
  • Twitch Name: Dante557
Re: Change coins won/lost in the Fight minigame
« Reply #1 on: July 31, 2017, 12:56:55 AM »
I mean, personally if you're just affecting the winnings and losses, you'd be looking more towards !fight_win_3 and !fight_lose_3.

Personally I wouldn't affect the user that is being taken on. Quite simply because it's unfair to punish a user that might not be in chat. However I would change the following to suit your needs. the @rand@ that you mentioned affects the base amount in this case. the base payout is a random number between 1 and 50. If you change the rand here it will also change the amount the other user loses.

Code: (!fight_win_3) [Select]
@if@[<=||@rand@[1|100]||10||/me (fight) @editpoints@[@user@|@calc@[*|@target@[2]|10]] @editpoints@[@target@[1]|-@target@[2]] @user@ used a @readfile@[Fight/user-weapons.txt] to fight @target@[1] who had a @readfile@[Fight/target-weapons.txt] and won @calc@[*|@target@[2]|10] @pointsname@||/me (fight) @editpoints@[@user@|@target@[2]] @editpoints@[@target@[1]|-@target@[2]] @user@ used a @readfile@[Fight/user-weapons.txt] to fight @target@[1] who had a @readfile@[Fight/target-weapons.txt] and won @target@[2] @pointsname@]
That command can easily be optimised (As @rand@ will stay the same throughout the command unless the unique modifier is added to it) but for simplicity sake, that's how it is.

The losing, however, is slightly more difficult. This is because @editpoints@ will happily take your points into the negative if you let it. An extra check needs to happen on the negative side

Code: (!fight_lose_3) [Select]
@if@[<=||@rand@[1|100]||10||/me (fight) @if@[<||@points@||@calc@[*|@target@[2]|10]||@editpoints@[@user@|-@calc@[-|@calc@[*|@target@[2]|10]|@points@]]||@editpoints@[@user@|-@calc@[*|@target@[2]|10]]] @editpoints@[@target@[1]|@target@[2]] @user@ used a @readfile@[Fight/user-weapons.txt] to fight @target@[1] who had a @readfile@[Fight/target-weapons.txt] and lost @calc@[*|@target@[2]|10] @pointsname@||/me (fight) @editpoints@[@user@|-@target@[2]] @editpoints@[@target@[1]|@target@[2]] @user@ used a @readfile@[Fight/user-weapons.txt] to fight @target@[1] who had a @readfile@[Fight/target-weapons.txt] and lost @target@[2] @pointsname@]
Haven't tested the lose code but the win code I did. Basically there's a 10% chance they will get a x10 win/lose payout. If you wish to change the % chance of this;
Code: [Select]
@if@[<=||@rand@[1|100]||10|| Change the 10 in there to whatever number you wish between 1 and 100. It's at the beginning of both the commands mentioned in here. I've made it so it's x10 by default but you should be able to see what you need to change if you wish to change the payout rate as well.

Again, there are simpler ways to do this (Basically working everything needed out in one command then passing the result through) but it SHOULD work as intended

Thanks,
Dante557
If you need to get through to me you can try to contact me on Twitter @ http://www.twitter.com/dante556

CreeCyan

  • Youngling
  • *
  • Posts: 22
  • Karma: +0/-0
  • Let's go gaming!
    • View Profile
    • CreeCyan on Twitch
  • Twitch Name: CreeCyan
Re: Change coins won/lost in the Fight minigame
« Reply #2 on: July 31, 2017, 07:56:05 PM »
I see, so I mistook the chance modifier for a coin range. :) I'll leave it as it is now, it's a fair point that it wouldn't be good to punish the target user as he has no choice whether to accept the fight or not. So small numbers make that a lot more innocent.
twitch.tv/CreeCyan