Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Add new bindings: getJobLevel & isJobUnlocked #386

Merged
merged 4 commits into from
Feb 24, 2020
Merged

Add new bindings: getJobLevel & isJobUnlocked #386

merged 4 commits into from
Feb 24, 2020

Conversation

zach2good
Copy link
Contributor

I affirm:

  • that I agree to Project Topaz's Limited Contributor License Agreement, as written on this date
  • that I've tested my code since the last commit in the PR, and will test after any later commits

As spoken about in discord, I added these to more easily support the Rhapsodies-style unlocking of the subjob with Gilgamesh's key item.

Tested with:

    print("Subjob Level: "..player:getJobLevel(0))
    print("WAR Level: "..player:getJobLevel(1))
    print("MNK Level: "..player:getJobLevel(1))
    print("DRG Level: "..player:getJobLevel(14))
    print("Subjob Unlocked: "..player:isJobUnlocked(0))
    print("WAR Unlocked: "..player:isJobUnlocked(1))
    print("MNK Unlocked: "..player:isJobUnlocked(1))
    print("DRG Unlocked: "..player:isJobUnlocked(14))
[23/Feb] [17:22:38][LUA Script] Subjob Level: 0
[23/Feb] [17:22:38][LUA Script] WAR Level: 99
[23/Feb] [17:22:38][LUA Script] MNK Level: 99
[23/Feb] [17:22:39][LUA Script] DRG Level: 0
[23/Feb] [17:22:39][LUA Script] Subjob Unlocked: 1
[23/Feb] [17:22:39][LUA Script] WAR Unlocked: 1
[23/Feb] [17:22:39][LUA Script] MNK Unlocked: 1
[23/Feb] [17:22:39][LUA Script] DRG Unlocked: 0

@ibm2431
Copy link
Contributor

ibm2431 commented Feb 23, 2020

isJobUnlocked, jobUnlocked, or unlockedJob?

@zach2good
Copy link
Contributor Author

Whatever you prefer?

@ibm2431
Copy link
Contributor

ibm2431 commented Feb 23, 2020

I am horrible at deciding on function names.

I want to say that unlockedJob is the closest to natural English:
player:unlockedJob(tpz.job.WAR) -> "Player unlocked (the) job Warrior?"

But then it'd only be two characters different from unlockJob. I don't know if this is a good or bad thing.

Let's see if anyone else has very strong opinions on what it should be called!

(Bindings themselves look fine.)

@TeoTwawki
Copy link
Contributor

TeoTwawki commented Feb 23, 2020

how about hasJob() ? hasJobUnlocked()?

also technically speaking, we could just check that the job has levels. its zero if not unlocked isn't it?

@zach2good
Copy link
Contributor Author

The reason I ended up doing two bindings is that you can't query for the level of job NON to find out if subjob is unlocked, you have to get the corresponding bit from jobs.unlocked. It felt dirty to check if the player has a subjob of any level to fulfil that condition

@TeoTwawki
Copy link
Contributor

I honestly would not have thought to check eithr of these at all to find out if sub was available. Just did not cross my mind. I was like "why's his example saying subjob level when we have a binding for getting sj level?" (which is for current sj and thus not what you wanted or meant).

tl;dr I didn't get it :)

@ibm2431
Copy link
Contributor

ibm2431 commented Feb 24, 2020

I like hasJob.

@ibm2431 ibm2431 changed the base branch from master to has-job-get-level February 24, 2020 23:04
@ibm2431 ibm2431 merged commit b14748b into project-topaz:has-job-get-level Feb 24, 2020
@zach2good zach2good deleted the getJobLevel branch February 25, 2020 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants