Hero Nisovin Usability Suggestion
In terms of the wand, the current spell casting system has been a bit wonky with the scrolling through the spells, so here is a possible rework for that.
Perhaps when you use the wand, your hotbar changes to the selection of the spell. Using the wand could either be sneaking with it or right clicking it. The source code is for the former, sneaking while holding the wand brings up the spell selection, and releasing shift casts the current spell you are hovering over and then returns your regular bar. If no spell is selected, your regular hotbar is returned without casting anything.
4 variables, remember to instantiate:
Player nis; //instance of whoever is playing nisovin
ItemStack[] hotbar; //length: 9, nisovin's hotbar; set when sneaking
ItemStack[] spellbar; //length: 9, the hotbar preset for spell selection
boolean prevSneak; //?nisovin sneaking last tick
Methods: run() called every tick
public void run(){
//we are detecting changes only, so sneak -> no sneak, or no sneak -> sneak
if(holdingWand()&&nis.isSneaking()&&(!prevSneak)){ //change holdingWand() to whatever used to detect such
//1st tick they are sneaking: change the hotbar to spells
setSpellBar();
}else if(holdingWand()&&(!nis.isSneaking)&&prevSneak){
//just released sneak: activate selected spell and return to regular bar
switch(nis.getItemInHand().getItemMeta().getDisplayName()){
//assuming item name = spell, can use other identification method
case "Tinder Flame":
//cast tinderflame
break;
//repeat for other spells
default:
//do nothing as no spell is selected
break;
}
setRegBar();
}
prevSneak = nis.isSneaking(); //set for the next tick
}
private void setSpellBar(){
PlayerInventory inv = nis.getInventory();
for(int i = 0; i < 9; i++){
//save the bar under hotbar
hotbar[i] = inv.getItem(i); //player inv: hotbar = {0-8} how convenient :)
//set the item to corresponding in spellbar
inv.setItem(i, spellbar[i]);
}
}
private void setRegBar(){
PlayerInventory inv = nis.getInventory();
for(int i = 0; i < 9; i++){
//return the bar
inv.setItem(i, hotbar[i]);
//remove hotbar holder (storage space, dont need to though)
hotbar[i] = null;
}
}
If it conflicts with the rocket boots (whatever it's called), that ability can just be changed to activating only on the primary weapon.
Edit: Fixed the format
Posted Jan 28, 2016, 10:41 PM UTC · edited
If I'm understanding this correctly, it seems like it would make spell casting much slower and clunkier, which isn't ideal in a game that uses a lot of reactionary functions.
The current casting system runs off of memory, so its clunky to change between them. Of course, my selection method can be to set the spell and not cast it.
I don't have any issues switching between them right now. Being able to just Click X times to get the spell I need, cast, hit it a few more times and cast again is quite efficient as is. Having to stop, hover over the right spell to set, then being able to cast only to do it again for each spell change doesn't seem great. Especially if it's bound to Shift which would mean you couldn't do it while running.
Edit: Maybe if it worked off of Hot Keys it would be better, so you could hold R-Click and hit 1, 2, 3 or 4 for each spell respectively. But having to hover your mouse over each spell, each time you need to change spells doesn't seem more efficient.