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

Temporary Run Credits #400

Merged
merged 2 commits into from
Jul 20, 2015
Merged

Conversation

laganojunior
Copy link
Contributor

I added tracking of temporary credits that are given at the beginning of the run and are returned at the end of the run. The amount of credits available on just the run (and will be returned at the end) is displayed on the credit count if applicable. I've implemented stimhack and bad publicity credits here.

@laganojunior laganojunior changed the title Feature/run credit Temporary Run Credits Jul 19, 2015
@nealterrell
Copy link
Collaborator

This is excellent 👍. I've done some testing on my dev machine and things are working beautifully.

  1. Making a run with 1 real credit and 1 BP, my UI shows "2 credits (1 for run)". I can pop SMC to go to "0 credits", install a 0-cost program, success.
  2. Using Stimhack with 1 real credit and 1 BP, my UI shows "11 credits (10 for run)". Pop SMC to install Torch, 0 credits, success.
  3. Using Stimhack with 0 real credits, "9 credits (9 for run)". End run, back to 0 credits. Success.
  4. Using Stimhack with 0 real credits, blah blah. Use 4 credits to pay for R&D Interface on Personal Workshop. Successful run, back to 0 credits. Success.

@mtgred may want to comment on the UI, as I believe he had a plan for how to show the run credits (in orange? I forget), but otherwise this is a great first contribution :).

BTW, did you do any collaboration with @justinliew on this? He has been working on a BP system in #362. (At first I actually thought this was his contribution!)

@queueseven
Copy link
Collaborator

Awesome 👍

@nealterrell
Copy link
Collaborator

@DominicKexel, perhaps you could help @laganojunior update can-pay? with :run-credit taken into account?

@laganojunior
Copy link
Contributor Author

@nealterrell No, I just picked up the source code and worked on it because I was running a deck with lots of BP and got annoyed that I had to keep track of BP credits for the runner. I figured that someone else was probably working on this, and perhaps they have a better design.

The UI does need work. Particularly, the run credit count isn't manually adjustable or back-trackable. E.g. if you want to redo a stimhack run and you manually adjust credits, or you manually adjust credits to pay through a pop-up window or Gagarin ability. Maybe something like "Added X run credits" and "Returned X run credits" in the chat log would help at least with the back-tracking part.

@nealterrell
I believe that can-pay? already "just works" since I just add all of the run credits to the general credit pool during the run.

@nealterrell
Copy link
Collaborator

Right on. I see what you mean about using the manual credit adjust -- the up/down arrows use change instead of pay. Try playing around with the UI -- maybe you can get a completely separate line for Run Credits with its own adjustment controls that only shows during a run when there are run credits to spend.

@justinliew
Copy link
Contributor

Looks great. I'll sync up and use this as a basis for the recurring credits.

@mtgred
Copy link
Owner

mtgred commented Jul 20, 2015

Awesome 👍

mtgred added a commit that referenced this pull request Jul 20, 2015
@mtgred mtgred merged commit d173337 into mtgred:master Jul 20, 2015
@JoelCFC25 JoelCFC25 mentioned this pull request Jul 20, 2015
@laganojunior laganojunior deleted the feature/run_credit branch July 22, 2015 07:17
@mtgred
Copy link
Owner

mtgred commented Jul 24, 2015

Using Tollbooth during a run doesn't take away run credit. I think it is because Tollbooth uses lose instead of pay.

@laganojunior Can you update your run credit code to also include lose?

@laganojunior
Copy link
Contributor Author

@mtgred I imagine it won't be hard to add more ways to use run credits. Can you take a look at #417 and tell me if that's a better way to represent run credits? It'll change the way I would have to implement this fix for tollbooth, and I don't want to have to implement the change twice.

laganojunior added a commit to laganojunior/netrunner that referenced this pull request Jul 27, 2015
This makes the lose function aware of run credits, so that credit
costs use run credits first. This is intended to fix github issue
 mtgred#400.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants